diff --git a/CHANGELOG.md b/CHANGELOG.md index fa29ee8..40ca303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [10.0.0] - 2024-10-15 +### Added +- Sample Change + ## [9.0.0] - revision 2024-07-15 ### Added - Added several method aliases based on previous operation IDs diff --git a/README.md b/README.md index 6d5ff83..6c38df1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Klaviyo Ruby SDK -- SDK version: 9.0.0 -- API revision: 2024-07-15 +- SDK version: 10.0.0 +- API revision: 2024-10-15 ## Helpful Resources -- [API Reference](https://developers.klaviyo.com/en/v2024-07-15/reference) -- [API Guides](https://developers.klaviyo.com/en/v2024-07-15/docs) +- [API Reference](https://developers.klaviyo.com/en/v2024-10-15/reference) +- [API Guides](https://developers.klaviyo.com/en/v2024-10-15/docs) - [Postman Workspace](https://www.postman.com/klaviyo/workspace/klaviyo-developers) ## Design & Approach @@ -71,6 +71,10 @@ This SDK is organized into the following resources: +- Reviews + + + - Segments @@ -83,6 +87,10 @@ This SDK is organized into the following resources: +- Tracking Settings + + + - Webhooks @@ -102,13 +110,13 @@ gem build klaviyo-api-sdk.gemspec Then install the gem locally: ```shell -gem install ./klaviyo-api-sdk-9.0.0.gem +gem install ./klaviyo-api-sdk-10.0.0.gem ``` Finally add this to the Gemfile: - gem 'klaviyo-api-sdk', '~> 9.0.0' + gem 'klaviyo-api-sdk', '~> 10.0.0' To install directly from rubygems: @@ -488,7 +496,7 @@ response = KlaviyoAPI::Events.get_events(opts) ## Comprehensive list of Operations & Parameters _**NOTE:**_ -- Organization: Resource groups and operation_ids are listed in alphabetical order, first by Resource name, then by **OpenAPI Summary**. Operation summaries are those listed in the right side bar of the [API Reference](https://developers.klaviyo.com/en/v2024-07-15/reference/get_events). +- Organization: Resource groups and operation_ids are listed in alphabetical order, first by Resource name, then by **OpenAPI Summary**. Operation summaries are those listed in the right side bar of the [API Reference](https://developers.klaviyo.com/en/v2024-10-15/reference/get_events). - For example values / data types, as well as whether parameters are required/optional, please reference the corresponding API Reference link. - Some args are required for the API call to succeed, the API docs above are the source of truth regarding which params are required. @@ -500,7 +508,7 @@ _**NOTE:**_ ## Accounts -#### [Get Account](https://developers.klaviyo.com/en/v2024-07-15/reference/get_account) +#### [Get Account](https://developers.klaviyo.com/en/v2024-10-15/reference/get_account) ```ruby KlaviyoAPI::Accounts.get_account(id, opts) @@ -510,7 +518,7 @@ KlaviyoAPI::Accounts.get_account(id, opts) -#### [Get Accounts](https://developers.klaviyo.com/en/v2024-07-15/reference/get_accounts) +#### [Get Accounts](https://developers.klaviyo.com/en/v2024-10-15/reference/get_accounts) ```ruby KlaviyoAPI::Accounts.get_accounts(opts) @@ -524,87 +532,107 @@ KlaviyoAPI::Accounts.get_accounts(opts) ## Campaigns -#### [Create Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign) +#### [Assign Template to Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/assign_template_to_campaign_message) ```ruby -KlaviyoAPI::Campaigns.create_campaign(body) +KlaviyoAPI::Campaigns.assign_template_to_campaign_message(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.create_campaign_message_assign_template(body) ``` -#### [Create Campaign Clone](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_clone) +#### [Cancel Campaign Send](https://developers.klaviyo.com/en/v2024-10-15/reference/cancel_campaign_send) ```ruby -KlaviyoAPI::Campaigns.create_campaign_clone(body) +KlaviyoAPI::Campaigns.cancel_campaign_send(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.update_campaign_send_job(id, body) ``` -#### [Assign Campaign Message Template](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_message_assign_template) +#### [Create Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/create_campaign) ```ruby -KlaviyoAPI::Campaigns.create_campaign_message_assign_template(body) +KlaviyoAPI::Campaigns.create_campaign(body) ``` -#### [Create Campaign Recipient Estimation Job](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_recipient_estimation_job) +#### [Create Campaign Clone](https://developers.klaviyo.com/en/v2024-10-15/reference/create_campaign_clone) ```ruby -KlaviyoAPI::Campaigns.create_campaign_recipient_estimation_job(body) +KlaviyoAPI::Campaigns.create_campaign_clone(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.clone_campaign(body) ``` -#### [Create Campaign Send Job](https://developers.klaviyo.com/en/v2024-07-15/reference/create_campaign_send_job) +#### [Delete Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_campaign) ```ruby -KlaviyoAPI::Campaigns.create_campaign_send_job(body) +KlaviyoAPI::Campaigns.delete_campaign(id) ``` -#### [Delete Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_campaign) +#### [Get Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign) ```ruby -KlaviyoAPI::Campaigns.delete_campaign(id) +KlaviyoAPI::Campaigns.get_campaign(id, opts) ``` -#### [Get Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign) +#### [Get Campaign for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_for_campaign_message) ```ruby -KlaviyoAPI::Campaigns.get_campaign(id, opts) +KlaviyoAPI::Campaigns.get_campaign_for_campaign_message(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.get_campaign_message_campaign(id, opts) ``` -#### [Get Campaign Campaign Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_campaign_messages) +#### [Get Campaign ID for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_id_for_campaign_message) ```ruby -KlaviyoAPI::Campaigns.get_campaign_campaign_messages(id, opts) +KlaviyoAPI::Campaigns.get_campaign_id_for_campaign_message(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.get_campaign_message_relationships_campaign(id) ``` -#### [Get Campaign Message](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message) +#### [Get Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_message) ```ruby KlaviyoAPI::Campaigns.get_campaign_message(id, opts) @@ -614,78 +642,90 @@ KlaviyoAPI::Campaigns.get_campaign_message(id, opts) -#### [Get Campaign Message Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_campaign) +#### [Get Campaign Recipient Estimation](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_recipient_estimation) ```ruby -KlaviyoAPI::Campaigns.get_campaign_message_campaign(id, opts) +KlaviyoAPI::Campaigns.get_campaign_recipient_estimation(id, opts) ``` -#### [Get Campaign Message Relationships Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_relationships_campaign) +#### [Get Campaign Recipient Estimation Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_recipient_estimation_job) ```ruby -KlaviyoAPI::Campaigns.get_campaign_message_relationships_campaign(id) +KlaviyoAPI::Campaigns.get_campaign_recipient_estimation_job(id, opts) ``` -#### [Get Campaign Message Relationships Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_relationships_template) +#### [Get Campaign Send Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_send_job) ```ruby -KlaviyoAPI::Campaigns.get_campaign_message_relationships_template(id) +KlaviyoAPI::Campaigns.get_campaign_send_job(id, opts) ``` -#### [Get Campaign Message Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_message_template) +#### [Get Campaign Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_tags) ```ruby -KlaviyoAPI::Campaigns.get_campaign_message_template(id, opts) +KlaviyoAPI::Campaigns.get_campaign_tags(id, opts) ``` -#### [Get Campaign Recipient Estimation](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_recipient_estimation) +#### [Get Campaigns](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaigns) ```ruby -KlaviyoAPI::Campaigns.get_campaign_recipient_estimation(id, opts) +KlaviyoAPI::Campaigns.get_campaigns(filter, opts) ``` -#### [Get Campaign Recipient Estimation Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_recipient_estimation_job) +#### [Get Message IDs for Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_message_ids_for_campaign) ```ruby -KlaviyoAPI::Campaigns.get_campaign_recipient_estimation_job(id, opts) +KlaviyoAPI::Campaigns.get_message_ids_for_campaign(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.get_campaign_relationships_campaign_messages(id) ``` -#### [Get Campaign Relationships Campaign Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_relationships_campaign_messages) +#### [Get Messages for Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_messages_for_campaign) ```ruby -KlaviyoAPI::Campaigns.get_campaign_relationships_campaign_messages(id) +KlaviyoAPI::Campaigns.get_messages_for_campaign(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.get_campaign_campaign_messages(id, opts) ``` -#### [Get Campaign Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_relationships_tags) +#### [Get Tag IDs for Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_campaign) +```ruby +KlaviyoAPI::Campaigns.get_tag_ids_for_campaign(id) +``` +##### Method alias: ```ruby KlaviyoAPI::Campaigns.get_campaign_relationships_tags(id) ``` @@ -694,60 +734,76 @@ KlaviyoAPI::Campaigns.get_campaign_relationships_tags(id) -#### [Get Campaign Send Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_send_job) +#### [Get Template for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_for_campaign_message) ```ruby -KlaviyoAPI::Campaigns.get_campaign_send_job(id, opts) +KlaviyoAPI::Campaigns.get_template_for_campaign_message(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.get_campaign_message_template(id, opts) ``` -#### [Get Campaign Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaign_tags) +#### [Get Template ID for Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_id_for_campaign_message) ```ruby -KlaviyoAPI::Campaigns.get_campaign_tags(id, opts) +KlaviyoAPI::Campaigns.get_template_id_for_campaign_message(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.get_campaign_message_relationships_template(id) ``` -#### [Get Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/get_campaigns) +#### [Refresh Campaign Recipient Estimation](https://developers.klaviyo.com/en/v2024-10-15/reference/refresh_campaign_recipient_estimation) ```ruby -KlaviyoAPI::Campaigns.get_campaigns(filter, opts) +KlaviyoAPI::Campaigns.refresh_campaign_recipient_estimation(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.create_campaign_recipient_estimation_job(body) ``` -#### [Update Campaign](https://developers.klaviyo.com/en/v2024-07-15/reference/update_campaign) +#### [Send Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/send_campaign) ```ruby -KlaviyoAPI::Campaigns.update_campaign(id, body) +KlaviyoAPI::Campaigns.send_campaign(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Campaigns.create_campaign_send_job(body) ``` -#### [Update Campaign Message](https://developers.klaviyo.com/en/v2024-07-15/reference/update_campaign_message) +#### [Update Campaign](https://developers.klaviyo.com/en/v2024-10-15/reference/update_campaign) ```ruby -KlaviyoAPI::Campaigns.update_campaign_message(id, body) +KlaviyoAPI::Campaigns.update_campaign(id, body) ``` -#### [Update Campaign Send Job](https://developers.klaviyo.com/en/v2024-07-15/reference/update_campaign_send_job) +#### [Update Campaign Message](https://developers.klaviyo.com/en/v2024-10-15/reference/update_campaign_message) ```ruby -KlaviyoAPI::Campaigns.update_campaign_send_job(id, body) +KlaviyoAPI::Campaigns.update_campaign_message(id, body) ``` @@ -758,28 +814,30 @@ KlaviyoAPI::Campaigns.update_campaign_send_job(id, body) ## Catalogs -#### [Create Back In Stock Subscription](https://developers.klaviyo.com/en/v2024-07-15/reference/create_back_in_stock_subscription) +#### [Add Category to Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/add_category_to_catalog_item) ```ruby -KlaviyoAPI::Catalogs.create_back_in_stock_subscription(body) +KlaviyoAPI::Catalogs.add_category_to_catalog_item(id, body) ``` - - - - - -#### [Create Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_category) - +##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_category(body) +KlaviyoAPI::Catalogs.create_catalog_item_relationships_categories(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_item_relationships_category(id, body) ``` -#### [Create Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_category_relationships_items) +#### [Add Items to Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/add_items_to_catalog_category) +```ruby +KlaviyoAPI::Catalogs.add_items_to_catalog_category(id, body) +``` +##### Method alias: ```ruby KlaviyoAPI::Catalogs.create_catalog_category_relationships_items(id, body) ``` @@ -792,579 +850,673 @@ KlaviyoAPI::Catalogs.create_catalog_category_relationships_item(id, body) -#### [Create Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_item) +#### [Bulk Create Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_catalog_categories) ```ruby -KlaviyoAPI::Catalogs.create_catalog_item(body) +KlaviyoAPI::Catalogs.bulk_create_catalog_categories(body) ``` - - - - - -#### [Create Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_item_relationships_categories) - +##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_item_relationships_categories(id, body) +KlaviyoAPI::Catalogs.spawn_create_categories_job(body) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_item_relationships_category(id, body) +KlaviyoAPI::Catalogs.create_catalog_category_bulk_create_job(body) ``` -#### [Create Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/create_catalog_variant) +#### [Bulk Create Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_catalog_items) ```ruby -KlaviyoAPI::Catalogs.create_catalog_variant(body) +KlaviyoAPI::Catalogs.bulk_create_catalog_items(body) ``` - - - - - -#### [Delete Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_category) - +##### Method alias: ```ruby -KlaviyoAPI::Catalogs.delete_catalog_category(id) +KlaviyoAPI::Catalogs.spawn_create_items_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_item_bulk_create_job(body) ``` -#### [Delete Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_category_relationships_items) +#### [Bulk Create Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_catalog_variants) ```ruby -KlaviyoAPI::Catalogs.delete_catalog_category_relationships_items(id, body) +KlaviyoAPI::Catalogs.bulk_create_catalog_variants(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_create_variants_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_variant_bulk_create_job(body) ``` -#### [Delete Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_item) +#### [Bulk Delete Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_delete_catalog_categories) ```ruby -KlaviyoAPI::Catalogs.delete_catalog_item(id) +KlaviyoAPI::Catalogs.bulk_delete_catalog_categories(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_delete_categories_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_category_bulk_delete_job(body) ``` -#### [Delete Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_item_relationships_categories) +#### [Bulk Delete Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_delete_catalog_items) ```ruby -KlaviyoAPI::Catalogs.delete_catalog_item_relationships_categories(id, body) +KlaviyoAPI::Catalogs.bulk_delete_catalog_items(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_delete_items_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_item_bulk_delete_job(body) ``` -#### [Delete Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_catalog_variant) +#### [Bulk Delete Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_delete_catalog_variants) ```ruby -KlaviyoAPI::Catalogs.delete_catalog_variant(id) +KlaviyoAPI::Catalogs.bulk_delete_catalog_variants(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_delete_variants_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_variant_bulk_delete_job(body) ``` -#### [Get Catalog Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_categories) +#### [Bulk Update Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_update_catalog_categories) ```ruby -KlaviyoAPI::Catalogs.get_catalog_categories(opts) +KlaviyoAPI::Catalogs.bulk_update_catalog_categories(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_update_categories_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_category_bulk_update_job(body) ``` -#### [Get Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_category) +#### [Bulk Update Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_update_catalog_items) ```ruby -KlaviyoAPI::Catalogs.get_catalog_category(id, opts) +KlaviyoAPI::Catalogs.bulk_update_catalog_items(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_update_items_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_item_bulk_update_job(body) ``` -#### [Get Catalog Category Items](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_category_items) +#### [Bulk Update Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_update_catalog_variants) ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_items(id, opts) +KlaviyoAPI::Catalogs.bulk_update_catalog_variants(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.spawn_update_variants_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.create_catalog_variant_bulk_update_job(body) ``` -#### [Get Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_category_relationships_items) +#### [Create Back In Stock Subscription](https://developers.klaviyo.com/en/v2024-10-15/reference/create_back_in_stock_subscription) ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_relationships_items(id, opts) +KlaviyoAPI::Catalogs.create_back_in_stock_subscription(body) ``` -#### [Get Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item) +#### [Create Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/create_catalog_category) ```ruby -KlaviyoAPI::Catalogs.get_catalog_item(id, opts) +KlaviyoAPI::Catalogs.create_catalog_category(body) ``` -#### [Get Catalog Item Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item_categories) +#### [Create Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/create_catalog_item) ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_categories(id, opts) +KlaviyoAPI::Catalogs.create_catalog_item(body) ``` -#### [Get Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item_relationships_categories) +#### [Create Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/create_catalog_variant) ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_relationships_categories(id, opts) +KlaviyoAPI::Catalogs.create_catalog_variant(body) ``` -#### [Get Catalog Item Variants](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_item_variants) +#### [Delete Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_catalog_category) ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_variants(id, opts) +KlaviyoAPI::Catalogs.delete_catalog_category(id) ``` -#### [Get Catalog Items](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_items) +#### [Delete Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_catalog_item) ```ruby -KlaviyoAPI::Catalogs.get_catalog_items(opts) +KlaviyoAPI::Catalogs.delete_catalog_item(id) ``` -#### [Get Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_variant) +#### [Delete Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_catalog_variant) ```ruby -KlaviyoAPI::Catalogs.get_catalog_variant(id, opts) +KlaviyoAPI::Catalogs.delete_catalog_variant(id) ``` -#### [Get Catalog Variants](https://developers.klaviyo.com/en/v2024-07-15/reference/get_catalog_variants) +#### [Get Bulk Create Catalog Items Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_catalog_items_job) ```ruby -KlaviyoAPI::Catalogs.get_catalog_variants(opts) +KlaviyoAPI::Catalogs.get_bulk_create_catalog_items_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_create_items_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_catalog_item_bulk_create_job(job_id, opts) ``` -#### [Get Create Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_categories_job) +#### [Get Bulk Create Catalog Items Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_catalog_items_jobs) ```ruby -KlaviyoAPI::Catalogs.get_create_categories_job(job_id, opts) +KlaviyoAPI::Catalogs.get_bulk_create_catalog_items_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_bulk_create_job(job_id, opts) +KlaviyoAPI::Catalogs.get_create_items_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_catalog_item_bulk_create_jobs(opts) ``` -#### [Get Create Categories Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_categories_jobs) +#### [Get Bulk Delete Catalog Items Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_delete_catalog_items_job) ```ruby -KlaviyoAPI::Catalogs.get_create_categories_jobs(opts) +KlaviyoAPI::Catalogs.get_bulk_delete_catalog_items_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_bulk_create_jobs(opts) +KlaviyoAPI::Catalogs.get_delete_items_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_catalog_item_bulk_delete_job(job_id, opts) ``` -#### [Get Create Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_items_job) +#### [Get Bulk Delete Catalog Items Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_delete_catalog_items_jobs) ```ruby -KlaviyoAPI::Catalogs.get_create_items_job(job_id, opts) +KlaviyoAPI::Catalogs.get_bulk_delete_catalog_items_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_bulk_create_job(job_id, opts) +KlaviyoAPI::Catalogs.get_delete_items_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_catalog_item_bulk_delete_jobs(opts) ``` -#### [Get Create Items Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_items_jobs) +#### [Get Bulk Update Catalog Items Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_update_catalog_items_job) ```ruby -KlaviyoAPI::Catalogs.get_create_items_jobs(opts) +KlaviyoAPI::Catalogs.get_bulk_update_catalog_items_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_bulk_create_jobs(opts) +KlaviyoAPI::Catalogs.get_update_items_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_catalog_item_bulk_update_job(job_id, opts) ``` -#### [Get Create Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_variants_job) +#### [Get Bulk Update Catalog Items Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_update_catalog_items_jobs) ```ruby -KlaviyoAPI::Catalogs.get_create_variants_job(job_id, opts) +KlaviyoAPI::Catalogs.get_bulk_update_catalog_items_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_variant_bulk_create_job(job_id, opts) +KlaviyoAPI::Catalogs.get_update_items_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.get_catalog_item_bulk_update_jobs(opts) ``` -#### [Get Create Variants Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_create_variants_jobs) +#### [Get Catalog Categories](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_categories) ```ruby -KlaviyoAPI::Catalogs.get_create_variants_jobs(opts) -``` -##### Method alias: -```ruby -KlaviyoAPI::Catalogs.get_catalog_variant_bulk_create_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_categories(opts) ``` -#### [Get Delete Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_categories_job) +#### [Get Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_category) ```ruby -KlaviyoAPI::Catalogs.get_delete_categories_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_category(id, opts) ``` -##### Method alias: + + + + + +#### [Get Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_item) + ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_bulk_delete_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_item(id, opts) ``` -#### [Get Delete Categories Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_categories_jobs) +#### [Get Catalog Items](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_items) ```ruby -KlaviyoAPI::Catalogs.get_delete_categories_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_items(opts) ``` -##### Method alias: + + + + + +#### [Get Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_variant) + ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_bulk_delete_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_variant(id, opts) ``` -#### [Get Delete Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_items_job) +#### [Get Catalog Variants](https://developers.klaviyo.com/en/v2024-10-15/reference/get_catalog_variants) ```ruby -KlaviyoAPI::Catalogs.get_delete_items_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_variants(opts) +``` + + + + + +#### [Get Categories for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_categories_for_catalog_item) + +```ruby +KlaviyoAPI::Catalogs.get_categories_for_catalog_item(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_bulk_delete_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_item_categories(id, opts) ``` -#### [Get Delete Items Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_items_jobs) +#### [Get Category IDs for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_category_ids_for_catalog_item) ```ruby -KlaviyoAPI::Catalogs.get_delete_items_jobs(opts) +KlaviyoAPI::Catalogs.get_category_ids_for_catalog_item(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_bulk_delete_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_item_relationships_categories(id, opts) ``` -#### [Get Delete Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_variants_job) +#### [Get Create Categories Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_categories_job) ```ruby -KlaviyoAPI::Catalogs.get_delete_variants_job(job_id, opts) +KlaviyoAPI::Catalogs.get_create_categories_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_variant_bulk_delete_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_category_bulk_create_job(job_id, opts) ``` -#### [Get Delete Variants Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_delete_variants_jobs) +#### [Get Create Categories Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_categories_jobs) ```ruby -KlaviyoAPI::Catalogs.get_delete_variants_jobs(opts) +KlaviyoAPI::Catalogs.get_create_categories_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_variant_bulk_delete_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_category_bulk_create_jobs(opts) ``` -#### [Get Update Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_categories_job) +#### [Get Create Variants Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_variants_job) ```ruby -KlaviyoAPI::Catalogs.get_update_categories_job(job_id, opts) +KlaviyoAPI::Catalogs.get_create_variants_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_bulk_update_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_variant_bulk_create_job(job_id, opts) ``` -#### [Get Update Categories Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_categories_jobs) +#### [Get Create Variants Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_create_variants_jobs) ```ruby -KlaviyoAPI::Catalogs.get_update_categories_jobs(opts) +KlaviyoAPI::Catalogs.get_create_variants_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_category_bulk_update_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_variant_bulk_create_jobs(opts) ``` -#### [Get Update Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_items_job) +#### [Get Delete Categories Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_categories_job) ```ruby -KlaviyoAPI::Catalogs.get_update_items_job(job_id, opts) +KlaviyoAPI::Catalogs.get_delete_categories_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_bulk_update_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_category_bulk_delete_job(job_id, opts) ``` -#### [Get Update Items Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_items_jobs) +#### [Get Delete Categories Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_categories_jobs) ```ruby -KlaviyoAPI::Catalogs.get_update_items_jobs(opts) +KlaviyoAPI::Catalogs.get_delete_categories_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_item_bulk_update_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_category_bulk_delete_jobs(opts) ``` -#### [Get Update Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_variants_job) +#### [Get Delete Variants Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_variants_job) ```ruby -KlaviyoAPI::Catalogs.get_update_variants_job(job_id, opts) +KlaviyoAPI::Catalogs.get_delete_variants_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_variant_bulk_update_job(job_id, opts) +KlaviyoAPI::Catalogs.get_catalog_variant_bulk_delete_job(job_id, opts) ``` -#### [Get Update Variants Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_update_variants_jobs) +#### [Get Delete Variants Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_delete_variants_jobs) ```ruby -KlaviyoAPI::Catalogs.get_update_variants_jobs(opts) +KlaviyoAPI::Catalogs.get_delete_variants_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.get_catalog_variant_bulk_update_jobs(opts) +KlaviyoAPI::Catalogs.get_catalog_variant_bulk_delete_jobs(opts) ``` -#### [Spawn Create Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_create_categories_job) +#### [Get Item IDs for Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/get_item_ids_for_catalog_category) ```ruby -KlaviyoAPI::Catalogs.spawn_create_categories_job(body) +KlaviyoAPI::Catalogs.get_item_ids_for_catalog_category(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_category_bulk_create_job(body) +KlaviyoAPI::Catalogs.get_catalog_category_relationships_items(id, opts) ``` -#### [Spawn Create Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_create_items_job) +#### [Get Items for Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/get_items_for_catalog_category) ```ruby -KlaviyoAPI::Catalogs.spawn_create_items_job(body) +KlaviyoAPI::Catalogs.get_items_for_catalog_category(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_item_bulk_create_job(body) +KlaviyoAPI::Catalogs.get_catalog_category_items(id, opts) ``` -#### [Spawn Create Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_create_variants_job) +#### [Get Update Categories Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_categories_job) ```ruby -KlaviyoAPI::Catalogs.spawn_create_variants_job(body) +KlaviyoAPI::Catalogs.get_update_categories_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_variant_bulk_create_job(body) +KlaviyoAPI::Catalogs.get_catalog_category_bulk_update_job(job_id, opts) ``` -#### [Spawn Delete Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_delete_categories_job) +#### [Get Update Categories Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_categories_jobs) ```ruby -KlaviyoAPI::Catalogs.spawn_delete_categories_job(body) +KlaviyoAPI::Catalogs.get_update_categories_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_category_bulk_delete_job(body) +KlaviyoAPI::Catalogs.get_catalog_category_bulk_update_jobs(opts) ``` -#### [Spawn Delete Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_delete_items_job) +#### [Get Update Variants Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_variants_job) ```ruby -KlaviyoAPI::Catalogs.spawn_delete_items_job(body) +KlaviyoAPI::Catalogs.get_update_variants_job(job_id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_item_bulk_delete_job(body) +KlaviyoAPI::Catalogs.get_catalog_variant_bulk_update_job(job_id, opts) ``` -#### [Spawn Delete Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_delete_variants_job) +#### [Get Update Variants Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_update_variants_jobs) ```ruby -KlaviyoAPI::Catalogs.spawn_delete_variants_job(body) +KlaviyoAPI::Catalogs.get_update_variants_jobs(opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_variant_bulk_delete_job(body) +KlaviyoAPI::Catalogs.get_catalog_variant_bulk_update_jobs(opts) ``` -#### [Spawn Update Categories Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_update_categories_job) +#### [Get Variants for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/get_variants_for_catalog_item) ```ruby -KlaviyoAPI::Catalogs.spawn_update_categories_job(body) +KlaviyoAPI::Catalogs.get_variants_for_catalog_item(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_category_bulk_update_job(body) +KlaviyoAPI::Catalogs.get_catalog_item_variants(id, opts) ``` -#### [Spawn Update Items Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_update_items_job) +#### [Remove Categories from Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_categories_from_catalog_item) ```ruby -KlaviyoAPI::Catalogs.spawn_update_items_job(body) +KlaviyoAPI::Catalogs.remove_categories_from_catalog_item(id, body) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_item_bulk_update_job(body) +KlaviyoAPI::Catalogs.delete_catalog_item_relationships_categories(id, body) ``` -#### [Spawn Update Variants Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_update_variants_job) +#### [Remove Items from Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_items_from_catalog_category) ```ruby -KlaviyoAPI::Catalogs.spawn_update_variants_job(body) +KlaviyoAPI::Catalogs.remove_items_from_catalog_category(id, body) ``` ##### Method alias: ```ruby -KlaviyoAPI::Catalogs.create_catalog_variant_bulk_update_job(body) +KlaviyoAPI::Catalogs.delete_catalog_category_relationships_items(id, body) ``` -#### [Update Catalog Category](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_category) +#### [Update Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/update_catalog_category) ```ruby KlaviyoAPI::Catalogs.update_catalog_category(id, body) @@ -1374,28 +1526,32 @@ KlaviyoAPI::Catalogs.update_catalog_category(id, body) -#### [Update Catalog Category Relationships Items](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_category_relationships_items) +#### [Update Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/update_catalog_item) ```ruby -KlaviyoAPI::Catalogs.update_catalog_category_relationships_items(id, body) +KlaviyoAPI::Catalogs.update_catalog_item(id, body) ``` -#### [Update Catalog Item](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_item) +#### [Update Catalog Variant](https://developers.klaviyo.com/en/v2024-10-15/reference/update_catalog_variant) ```ruby -KlaviyoAPI::Catalogs.update_catalog_item(id, body) +KlaviyoAPI::Catalogs.update_catalog_variant(id, body) ``` -#### [Update Catalog Item Relationships Categories](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_item_relationships_categories) +#### [Update Categories for Catalog Item](https://developers.klaviyo.com/en/v2024-10-15/reference/update_categories_for_catalog_item) +```ruby +KlaviyoAPI::Catalogs.update_categories_for_catalog_item(id, body) +``` +##### Method alias: ```ruby KlaviyoAPI::Catalogs.update_catalog_item_relationships_categories(id, body) ``` @@ -1404,10 +1560,14 @@ KlaviyoAPI::Catalogs.update_catalog_item_relationships_categories(id, body) -#### [Update Catalog Variant](https://developers.klaviyo.com/en/v2024-07-15/reference/update_catalog_variant) +#### [Update Items for Catalog Category](https://developers.klaviyo.com/en/v2024-10-15/reference/update_items_for_catalog_category) ```ruby -KlaviyoAPI::Catalogs.update_catalog_variant(id, body) +KlaviyoAPI::Catalogs.update_items_for_catalog_category(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Catalogs.update_catalog_category_relationships_items(id, body) ``` @@ -1418,7 +1578,25 @@ KlaviyoAPI::Catalogs.update_catalog_variant(id, body) ## Coupons -#### [Create Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/create_coupon) +#### [Bulk Create Coupon Codes](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_coupon_codes) + +```ruby +KlaviyoAPI::Coupons.bulk_create_coupon_codes(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Coupons.spawn_coupon_code_bulk_create_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Coupons.create_coupon_code_bulk_create_job(body) +``` + + + + + +#### [Create Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/create_coupon) ```ruby KlaviyoAPI::Coupons.create_coupon(body) @@ -1428,7 +1606,7 @@ KlaviyoAPI::Coupons.create_coupon(body) -#### [Create Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/create_coupon_code) +#### [Create Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/create_coupon_code) ```ruby KlaviyoAPI::Coupons.create_coupon_code(body) @@ -1438,7 +1616,7 @@ KlaviyoAPI::Coupons.create_coupon_code(body) -#### [Delete Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_coupon) +#### [Delete Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_coupon) ```ruby KlaviyoAPI::Coupons.delete_coupon(id) @@ -1448,7 +1626,7 @@ KlaviyoAPI::Coupons.delete_coupon(id) -#### [Delete Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_coupon_code) +#### [Delete Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_coupon_code) ```ruby KlaviyoAPI::Coupons.delete_coupon_code(id) @@ -1458,57 +1636,69 @@ KlaviyoAPI::Coupons.delete_coupon_code(id) -#### [Get Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon) +#### [Get Bulk Create Coupon Code Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_coupon_code_jobs) ```ruby -KlaviyoAPI::Coupons.get_coupon(id, opts) +KlaviyoAPI::Coupons.get_bulk_create_coupon_code_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Coupons.get_coupon_code_bulk_create_jobs(opts) ``` -#### [Get Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code) +#### [Get Bulk Create Coupon Codes Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_create_coupon_codes_job) ```ruby -KlaviyoAPI::Coupons.get_coupon_code(id, opts) +KlaviyoAPI::Coupons.get_bulk_create_coupon_codes_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Coupons.get_coupon_code_bulk_create_job(job_id, opts) ``` -#### [Get Coupon Code Bulk Create Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code_bulk_create_job) +#### [Get Code IDs for Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/get_code_ids_for_coupon) ```ruby -KlaviyoAPI::Coupons.get_coupon_code_bulk_create_job(job_id, opts) +KlaviyoAPI::Coupons.get_code_ids_for_coupon(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Coupons.get_coupon_code_relationships_coupon(id, opts) ``` -#### [Get Coupon Code Bulk Create Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code_bulk_create_jobs) +#### [Get Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon) ```ruby -KlaviyoAPI::Coupons.get_coupon_code_bulk_create_jobs(opts) +KlaviyoAPI::Coupons.get_coupon(id, opts) ``` -#### [Get Coupon Code Relationships Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_code_relationships_coupon) +#### [Get Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_code) ```ruby -KlaviyoAPI::Coupons.get_coupon_code_relationships_coupon(id, opts) +KlaviyoAPI::Coupons.get_coupon_code(id, opts) ``` -#### [Get Coupon Codes](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_codes) +#### [Get Coupon Codes](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_codes) ```ruby KlaviyoAPI::Coupons.get_coupon_codes(opts) @@ -1518,7 +1708,7 @@ KlaviyoAPI::Coupons.get_coupon_codes(opts) -#### [Get Coupon Codes For Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_codes_for_coupon) +#### [Get Coupon Codes For Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_codes_for_coupon) ```ruby KlaviyoAPI::Coupons.get_coupon_codes_for_coupon(id, opts) @@ -1532,7 +1722,7 @@ KlaviyoAPI::Coupons.get_coupon_coupon_codes(id, opts) -#### [Get Coupon For Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_for_coupon_code) +#### [Get Coupon For Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_for_coupon_code) ```ruby KlaviyoAPI::Coupons.get_coupon_for_coupon_code(id, opts) @@ -1546,41 +1736,31 @@ KlaviyoAPI::Coupons.get_coupon_code_coupon(id, opts) -#### [Get Coupon Relationships Coupon Codes](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupon_relationships_coupon_codes) +#### [Get Coupon ID for Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupon_id_for_coupon_code) ```ruby -KlaviyoAPI::Coupons.get_coupon_relationships_coupon_codes(id) +KlaviyoAPI::Coupons.get_coupon_id_for_coupon_code(id) ``` - - - - - -#### [Get Coupons](https://developers.klaviyo.com/en/v2024-07-15/reference/get_coupons) - +##### Method alias: ```ruby -KlaviyoAPI::Coupons.get_coupons(opts) +KlaviyoAPI::Coupons.get_coupon_relationships_coupon_codes(id) ``` -#### [Spawn Coupon Code Bulk Create Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_coupon_code_bulk_create_job) +#### [Get Coupons](https://developers.klaviyo.com/en/v2024-10-15/reference/get_coupons) ```ruby -KlaviyoAPI::Coupons.spawn_coupon_code_bulk_create_job(body) -``` -##### Method alias: -```ruby -KlaviyoAPI::Coupons.create_coupon_code_bulk_create_job(body) +KlaviyoAPI::Coupons.get_coupons(opts) ``` -#### [Update Coupon](https://developers.klaviyo.com/en/v2024-07-15/reference/update_coupon) +#### [Update Coupon](https://developers.klaviyo.com/en/v2024-10-15/reference/update_coupon) ```ruby KlaviyoAPI::Coupons.update_coupon(id, body) @@ -1590,7 +1770,7 @@ KlaviyoAPI::Coupons.update_coupon(id, body) -#### [Update Coupon Code](https://developers.klaviyo.com/en/v2024-07-15/reference/update_coupon_code) +#### [Update Coupon Code](https://developers.klaviyo.com/en/v2024-10-15/reference/update_coupon_code) ```ruby KlaviyoAPI::Coupons.update_coupon_code(id, body) @@ -1604,7 +1784,7 @@ KlaviyoAPI::Coupons.update_coupon_code(id, body) ## Data Privacy -#### [Request Profile Deletion](https://developers.klaviyo.com/en/v2024-07-15/reference/request_profile_deletion) +#### [Request Profile Deletion](https://developers.klaviyo.com/en/v2024-10-15/reference/request_profile_deletion) ```ruby KlaviyoAPI::DataPrivacy.request_profile_deletion(body) @@ -1622,7 +1802,7 @@ KlaviyoAPI::DataPrivacy.create_data_privacy_deletion_job(body) ## Events -#### [Bulk Create Events](https://developers.klaviyo.com/en/v2024-07-15/reference/bulk_create_events) +#### [Bulk Create Events](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_create_events) ```ruby KlaviyoAPI::Events.bulk_create_events(body) @@ -1636,7 +1816,7 @@ KlaviyoAPI::Events.create_event_bulk_create_job(body) -#### [Create Event](https://developers.klaviyo.com/en/v2024-07-15/reference/create_event) +#### [Create Event](https://developers.klaviyo.com/en/v2024-10-15/reference/create_event) ```ruby KlaviyoAPI::Events.create_event(body) @@ -1646,7 +1826,7 @@ KlaviyoAPI::Events.create_event(body) -#### [Get Event](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event) +#### [Get Event](https://developers.klaviyo.com/en/v2024-10-15/reference/get_event) ```ruby KlaviyoAPI::Events.get_event(id, opts) @@ -1656,7 +1836,7 @@ KlaviyoAPI::Events.get_event(id, opts) -#### [Get Event Metric](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_metric) +#### [Get Event Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_event_metric) ```ruby KlaviyoAPI::Events.get_event_metric(id, opts) @@ -1666,7 +1846,7 @@ KlaviyoAPI::Events.get_event_metric(id, opts) -#### [Get Event Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_profile) +#### [Get Event Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_event_profile) ```ruby KlaviyoAPI::Events.get_event_profile(id, opts) @@ -1676,30 +1856,38 @@ KlaviyoAPI::Events.get_event_profile(id, opts) -#### [Get Event Relationships Metric](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_relationships_metric) +#### [Get Events](https://developers.klaviyo.com/en/v2024-10-15/reference/get_events) ```ruby -KlaviyoAPI::Events.get_event_relationships_metric(id) +KlaviyoAPI::Events.get_events(opts) ``` -#### [Get Event Relationships Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/get_event_relationships_profile) +#### [Get Metric ID for Event](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_id_for_event) ```ruby -KlaviyoAPI::Events.get_event_relationships_profile(id) +KlaviyoAPI::Events.get_metric_id_for_event(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Events.get_event_relationships_metric(id) ``` -#### [Get Events](https://developers.klaviyo.com/en/v2024-07-15/reference/get_events) +#### [Get Profile ID for Event](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_id_for_event) ```ruby -KlaviyoAPI::Events.get_events(opts) +KlaviyoAPI::Events.get_profile_id_for_event(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Events.get_event_relationships_profile(id) ``` @@ -1710,7 +1898,7 @@ KlaviyoAPI::Events.get_events(opts) ## Flows -#### [Delete Flow](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_flow) +#### [Delete Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_flow) ```ruby KlaviyoAPI::Flows.delete_flow(id) @@ -1720,77 +1908,93 @@ KlaviyoAPI::Flows.delete_flow(id) -#### [Get Flow](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow) +#### [Get Action ID for Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_action_id_for_flow_message) ```ruby -KlaviyoAPI::Flows.get_flow(id, opts) +KlaviyoAPI::Flows.get_action_id_for_flow_message(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_message_relationships_action(id) ``` -#### [Get Flow Action](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action) +#### [Get Action IDs for Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_action_ids_for_flow) ```ruby -KlaviyoAPI::Flows.get_flow_action(id, opts) +KlaviyoAPI::Flows.get_action_ids_for_flow(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_relationships_flow_actions(id, opts) ``` -#### [Get Flow For Flow Action](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_flow) +#### [Get Actions for Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_actions_for_flow) ```ruby -KlaviyoAPI::Flows.get_flow_action_flow(id, opts) +KlaviyoAPI::Flows.get_actions_for_flow(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_flow_actions(id, opts) ``` -#### [Get Flow Action Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_messages) +#### [Get Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow) ```ruby -KlaviyoAPI::Flows.get_flow_action_messages(id, opts) +KlaviyoAPI::Flows.get_flow(id, opts) ``` -#### [Get Flow Action Relationships Flow](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_relationships_flow) +#### [Get Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_action) ```ruby -KlaviyoAPI::Flows.get_flow_action_relationships_flow(id) +KlaviyoAPI::Flows.get_flow_action(id, opts) ``` -#### [Get Flow Action Relationships Messages](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_action_relationships_messages) +#### [Get Flow For Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_action_flow) ```ruby -KlaviyoAPI::Flows.get_flow_action_relationships_messages(id, opts) +KlaviyoAPI::Flows.get_flow_action_flow(id, opts) ``` -#### [Get Flow Flow Actions](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_flow_actions) +#### [Get Flow ID for Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_id_for_flow_action) ```ruby -KlaviyoAPI::Flows.get_flow_flow_actions(id, opts) +KlaviyoAPI::Flows.get_flow_id_for_flow_action(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_action_relationships_flow(id) ``` -#### [Get Flow Message](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message) +#### [Get Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_message) ```ruby KlaviyoAPI::Flows.get_flow_message(id, opts) @@ -1800,7 +2004,7 @@ KlaviyoAPI::Flows.get_flow_message(id, opts) -#### [Get Flow Action For Message](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_action) +#### [Get Flow Action For Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_message_action) ```ruby KlaviyoAPI::Flows.get_flow_message_action(id, opts) @@ -1810,48 +2014,60 @@ KlaviyoAPI::Flows.get_flow_message_action(id, opts) -#### [Get Flow Message Relationships Action](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_relationships_action) +#### [Get Flow Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_tags) ```ruby -KlaviyoAPI::Flows.get_flow_message_relationships_action(id) +KlaviyoAPI::Flows.get_flow_tags(id, opts) ``` -#### [Get Flow Message Relationships Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_relationships_template) +#### [Get Flows](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flows) ```ruby -KlaviyoAPI::Flows.get_flow_message_relationships_template(id) +KlaviyoAPI::Flows.get_flows(opts) ``` -#### [Get Flow Message Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_message_template) +#### [Get Message IDs for Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_message_ids_for_flow_action) ```ruby -KlaviyoAPI::Flows.get_flow_message_template(id, opts) +KlaviyoAPI::Flows.get_message_ids_for_flow_action(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_action_relationships_messages(id, opts) ``` -#### [Get Flow Relationships Flow Actions](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_relationships_flow_actions) +#### [Get Messages for Flow Action](https://developers.klaviyo.com/en/v2024-10-15/reference/get_messages_for_flow_action) ```ruby -KlaviyoAPI::Flows.get_flow_relationships_flow_actions(id, opts) +KlaviyoAPI::Flows.get_messages_for_flow_action(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_action_messages(id, opts) ``` -#### [Get Flow Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_relationships_tags) +#### [Get Tag IDs for Flow](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_flow) +```ruby +KlaviyoAPI::Flows.get_tag_ids_for_flow(id) +``` +##### Method alias: ```ruby KlaviyoAPI::Flows.get_flow_relationships_tags(id) ``` @@ -1860,27 +2076,35 @@ KlaviyoAPI::Flows.get_flow_relationships_tags(id) -#### [Get Flow Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flow_tags) +#### [Get Template for Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_for_flow_message) ```ruby -KlaviyoAPI::Flows.get_flow_tags(id, opts) +KlaviyoAPI::Flows.get_template_for_flow_message(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_message_template(id, opts) ``` -#### [Get Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/get_flows) +#### [Get Template ID for Flow Message](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template_id_for_flow_message) ```ruby -KlaviyoAPI::Flows.get_flows(opts) +KlaviyoAPI::Flows.get_template_id_for_flow_message(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Flows.get_flow_message_relationships_template(id) ``` -#### [Update Flow Status](https://developers.klaviyo.com/en/v2024-07-15/reference/update_flow) +#### [Update Flow Status](https://developers.klaviyo.com/en/v2024-10-15/reference/update_flow) ```ruby KlaviyoAPI::Flows.update_flow(id, body) @@ -1894,7 +2118,7 @@ KlaviyoAPI::Flows.update_flow(id, body) ## Forms -#### [Get Form](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form) +#### [Get Form](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form) ```ruby KlaviyoAPI::Forms.get_form(id, opts) @@ -1904,7 +2128,7 @@ KlaviyoAPI::Forms.get_form(id, opts) -#### [Get Form for Form Version](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form_for_form_version) +#### [Get Form for Form Version](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form_for_form_version) ```ruby KlaviyoAPI::Forms.get_form_for_form_version(id, opts) @@ -1918,7 +2142,7 @@ KlaviyoAPI::Forms.get_form_version_form(id, opts) -#### [Get Form ID for Form Version](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form_id_for_form_version) +#### [Get Form ID for Form Version](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form_id_for_form_version) ```ruby KlaviyoAPI::Forms.get_form_id_for_form_version(id) @@ -1932,7 +2156,7 @@ KlaviyoAPI::Forms.get_form_version_relationships_form(id) -#### [Get Form Version](https://developers.klaviyo.com/en/v2024-07-15/reference/get_form_version) +#### [Get Form Version](https://developers.klaviyo.com/en/v2024-10-15/reference/get_form_version) ```ruby KlaviyoAPI::Forms.get_form_version(id, opts) @@ -1942,7 +2166,7 @@ KlaviyoAPI::Forms.get_form_version(id, opts) -#### [Get Forms](https://developers.klaviyo.com/en/v2024-07-15/reference/get_forms) +#### [Get Forms](https://developers.klaviyo.com/en/v2024-10-15/reference/get_forms) ```ruby KlaviyoAPI::Forms.get_forms(opts) @@ -1952,7 +2176,7 @@ KlaviyoAPI::Forms.get_forms(opts) -#### [Get Version IDs for Form](https://developers.klaviyo.com/en/v2024-07-15/reference/get_version_ids_for_form) +#### [Get Version IDs for Form](https://developers.klaviyo.com/en/v2024-10-15/reference/get_version_ids_for_form) ```ruby KlaviyoAPI::Forms.get_version_ids_for_form(id) @@ -1966,7 +2190,7 @@ KlaviyoAPI::Forms.get_form_relationships_form_versions(id) -#### [Get Versions for Form](https://developers.klaviyo.com/en/v2024-07-15/reference/get_versions_for_form) +#### [Get Versions for Form](https://developers.klaviyo.com/en/v2024-10-15/reference/get_versions_for_form) ```ruby KlaviyoAPI::Forms.get_versions_for_form(id, opts) @@ -1984,7 +2208,7 @@ KlaviyoAPI::Forms.get_form_form_versions(id, opts) ## Images -#### [Get Image](https://developers.klaviyo.com/en/v2024-07-15/reference/get_image) +#### [Get Image](https://developers.klaviyo.com/en/v2024-10-15/reference/get_image) ```ruby KlaviyoAPI::Images.get_image(id, opts) @@ -1994,7 +2218,7 @@ KlaviyoAPI::Images.get_image(id, opts) -#### [Get Images](https://developers.klaviyo.com/en/v2024-07-15/reference/get_images) +#### [Get Images](https://developers.klaviyo.com/en/v2024-10-15/reference/get_images) ```ruby KlaviyoAPI::Images.get_images(opts) @@ -2004,7 +2228,7 @@ KlaviyoAPI::Images.get_images(opts) -#### [Update Image](https://developers.klaviyo.com/en/v2024-07-15/reference/update_image) +#### [Update Image](https://developers.klaviyo.com/en/v2024-10-15/reference/update_image) ```ruby KlaviyoAPI::Images.update_image(id, body) @@ -2014,7 +2238,7 @@ KlaviyoAPI::Images.update_image(id, body) -#### [Upload Image From File](https://developers.klaviyo.com/en/v2024-07-15/reference/upload_image_from_file) +#### [Upload Image From File](https://developers.klaviyo.com/en/v2024-10-15/reference/upload_image_from_file) ```ruby KlaviyoAPI::Images.upload_image_from_file(file, opts) @@ -2028,7 +2252,7 @@ KlaviyoAPI::Images.create_image_upload(file, opts) -#### [Upload Image From URL](https://developers.klaviyo.com/en/v2024-07-15/reference/upload_image_from_url) +#### [Upload Image From URL](https://developers.klaviyo.com/en/v2024-10-15/reference/upload_image_from_url) ```ruby KlaviyoAPI::Images.upload_image_from_url(body) @@ -2046,7 +2270,7 @@ KlaviyoAPI::Images.create_image(body) ## Lists -#### [Create List](https://developers.klaviyo.com/en/v2024-07-15/reference/create_list) +#### [Create List](https://developers.klaviyo.com/en/v2024-10-15/reference/create_list) ```ruby KlaviyoAPI::Lists.create_list(body) @@ -2056,7 +2280,7 @@ KlaviyoAPI::Lists.create_list(body) -#### [Add Profile To List](https://developers.klaviyo.com/en/v2024-07-15/reference/create_list_relationships) +#### [Add Profile To List](https://developers.klaviyo.com/en/v2024-10-15/reference/create_list_relationships) ```ruby KlaviyoAPI::Lists.create_list_relationships(id, body) @@ -2070,7 +2294,7 @@ KlaviyoAPI::Lists.create_list_relationships_profile(id, body) -#### [Delete List](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_list) +#### [Delete List](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_list) ```ruby KlaviyoAPI::Lists.delete_list(id) @@ -2080,7 +2304,7 @@ KlaviyoAPI::Lists.delete_list(id) -#### [Remove Profile From List](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_list_relationships) +#### [Remove Profile From List](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_list_relationships) ```ruby KlaviyoAPI::Lists.delete_list_relationships(id, body) @@ -2094,7 +2318,7 @@ KlaviyoAPI::Lists.delete_list_relationships_profiles(id, body) -#### [Get List](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list) +#### [Get List](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list) ```ruby KlaviyoAPI::Lists.get_list(id, opts) @@ -2104,37 +2328,37 @@ KlaviyoAPI::Lists.get_list(id, opts) -#### [Get List Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_profiles) +#### [Get List Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_flow_triggers) ```ruby -KlaviyoAPI::Lists.get_list_profiles(id, opts) +KlaviyoAPI::Lists.get_list_flow_triggers(id, opts) ``` -#### [Get List Relationships Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_relationships_profiles) +#### [Get List Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_profiles) ```ruby -KlaviyoAPI::Lists.get_list_relationships_profiles(id, opts) +KlaviyoAPI::Lists.get_list_profiles(id, opts) ``` -#### [Get List Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_relationships_tags) +#### [Get List Relationships Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_relationships_flow_triggers) ```ruby -KlaviyoAPI::Lists.get_list_relationships_tags(id) +KlaviyoAPI::Lists.get_list_relationships_flow_triggers(id) ``` -#### [Get List Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_list_tags) +#### [Get List Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_tags) ```ruby KlaviyoAPI::Lists.get_list_tags(id, opts) @@ -2144,7 +2368,7 @@ KlaviyoAPI::Lists.get_list_tags(id, opts) -#### [Get Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_lists) +#### [Get Lists](https://developers.klaviyo.com/en/v2024-10-15/reference/get_lists) ```ruby KlaviyoAPI::Lists.get_lists(opts) @@ -2154,7 +2378,35 @@ KlaviyoAPI::Lists.get_lists(opts) -#### [Update List](https://developers.klaviyo.com/en/v2024-07-15/reference/update_list) +#### [Get Profile IDs for List](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_ids_for_list) + +```ruby +KlaviyoAPI::Lists.get_profile_ids_for_list(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Lists.get_list_relationships_profiles(id, opts) +``` + + + + + +#### [Get Tag IDs for List](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_list) + +```ruby +KlaviyoAPI::Lists.get_tag_ids_for_list(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Lists.get_list_relationships_tags(id) +``` + + + + + +#### [Update List](https://developers.klaviyo.com/en/v2024-10-15/reference/update_list) ```ruby KlaviyoAPI::Lists.update_list(id, body) @@ -2168,7 +2420,7 @@ KlaviyoAPI::Lists.update_list(id, body) ## Metrics -#### [Get Metric](https://developers.klaviyo.com/en/v2024-07-15/reference/get_metric) +#### [Get Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric) ```ruby KlaviyoAPI::Metrics.get_metric(id, opts) @@ -2178,20 +2430,106 @@ KlaviyoAPI::Metrics.get_metric(id, opts) -#### [Get Metrics](https://developers.klaviyo.com/en/v2024-07-15/reference/get_metrics) +#### [Get Metric Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_flow_triggers) ```ruby -KlaviyoAPI::Metrics.get_metrics(opts) +KlaviyoAPI::Metrics.get_metric_flow_triggers(id, opts) ``` -#### [Query Metric Aggregates](https://developers.klaviyo.com/en/v2024-07-15/reference/query_metric_aggregates) +#### [Get Metric for Metric Property](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_for_metric_property) ```ruby -KlaviyoAPI::Metrics.query_metric_aggregates(body) +KlaviyoAPI::Metrics.get_metric_for_metric_property(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Metrics.get_metric_property_metric(id, opts) +``` + + + + + +#### [Get Metric ID for Metric Property](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_id_for_metric_property) + +```ruby +KlaviyoAPI::Metrics.get_metric_id_for_metric_property(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Metrics.get_metric_property_relationships_metric(id) +``` + + + + + +#### [Get Metric Property](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_property) + +```ruby +KlaviyoAPI::Metrics.get_metric_property(id, opts) +``` + + + + + +#### [Get Metric Relationships Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metric_relationships_flow_triggers) + +```ruby +KlaviyoAPI::Metrics.get_metric_relationships_flow_triggers(id) +``` + + + + + +#### [Get Metrics](https://developers.klaviyo.com/en/v2024-10-15/reference/get_metrics) + +```ruby +KlaviyoAPI::Metrics.get_metrics(opts) +``` + + + + + +#### [Get Properties for Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_properties_for_metric) + +```ruby +KlaviyoAPI::Metrics.get_properties_for_metric(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Metrics.get_metric_metric_properties(id, opts) +``` + + + + + +#### [Get Property IDs for Metric](https://developers.klaviyo.com/en/v2024-10-15/reference/get_property_ids_for_metric) + +```ruby +KlaviyoAPI::Metrics.get_property_ids_for_metric(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Metrics.get_metric_relationships_metric_properties(id) +``` + + + + + +#### [Query Metric Aggregates](https://developers.klaviyo.com/en/v2024-10-15/reference/query_metric_aggregates) + +```ruby +KlaviyoAPI::Metrics.query_metric_aggregates(body) ``` ##### Method alias: ```ruby @@ -2206,7 +2544,79 @@ KlaviyoAPI::Metrics.create_metric_aggregate(body) ## Profiles -#### [Create or Update Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/create_or_update_profile) +#### [Bulk Subscribe Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_subscribe_profiles) + +```ruby +KlaviyoAPI::Profiles.bulk_subscribe_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.subscribe_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.create_profile_subscription_bulk_create_job(body) +``` + + + + + +#### [Bulk Suppress Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_suppress_profiles) + +```ruby +KlaviyoAPI::Profiles.bulk_suppress_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.suppress_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.create_profile_suppression_bulk_create_job(body) +``` + + + + + +#### [Bulk Unsubscribe Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_unsubscribe_profiles) + +```ruby +KlaviyoAPI::Profiles.bulk_unsubscribe_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.unsubscribe_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.create_profile_subscription_bulk_delete_job(body) +``` + + + + + +#### [Bulk Unsuppress Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/bulk_unsuppress_profiles) + +```ruby +KlaviyoAPI::Profiles.bulk_unsuppress_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.unsuppress_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.create_profile_suppression_bulk_delete_job(body) +``` + + + + + +#### [Create or Update Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/create_or_update_profile) ```ruby KlaviyoAPI::Profiles.create_or_update_profile(body) @@ -2220,7 +2630,7 @@ KlaviyoAPI::Profiles.create_profile_import(body) -#### [Create Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/create_profile) +#### [Create Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/create_profile) ```ruby KlaviyoAPI::Profiles.create_profile(body) @@ -2230,7 +2640,7 @@ KlaviyoAPI::Profiles.create_profile(body) -#### [Create or Update Push Token](https://developers.klaviyo.com/en/v2024-07-15/reference/create_push_token) +#### [Create or Update Push Token](https://developers.klaviyo.com/en/v2024-10-15/reference/create_push_token) ```ruby KlaviyoAPI::Profiles.create_push_token(body) @@ -2240,8 +2650,12 @@ KlaviyoAPI::Profiles.create_push_token(body) -#### [Get Bulk Profile Import Job](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job) +#### [Get Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_import_profiles_job) +```ruby +KlaviyoAPI::Profiles.get_bulk_import_profiles_job(job_id, opts) +``` +##### Method alias: ```ruby KlaviyoAPI::Profiles.get_bulk_profile_import_job(job_id, opts) ``` @@ -2254,284 +2668,538 @@ KlaviyoAPI::Profiles.get_profile_bulk_import_job(job_id, opts) -#### [Get Bulk Profile Import Job Errors](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_import_errors) +#### [Get Bulk Import Profiles Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_import_profiles_jobs) + +```ruby +KlaviyoAPI::Profiles.get_bulk_import_profiles_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_bulk_profile_import_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_bulk_import_jobs(opts) +``` + + + + + +#### [Get Bulk Suppress Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_suppress_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_bulk_suppress_profiles_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_suppression_bulk_create_job(job_id, opts) +``` + + + + + +#### [Get Bulk Suppress Profiles Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_suppress_profiles_jobs) + +```ruby +KlaviyoAPI::Profiles.get_bulk_suppress_profiles_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_suppression_bulk_create_jobs(opts) +``` + + + + + +#### [Get Bulk Unsuppress Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_unsuppress_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_bulk_unsuppress_profiles_job(job_id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_suppression_bulk_delete_job(job_id, opts) +``` + + + + + +#### [Get Bulk Unsuppress Profiles Jobs](https://developers.klaviyo.com/en/v2024-10-15/reference/get_bulk_unsuppress_profiles_jobs) + +```ruby +KlaviyoAPI::Profiles.get_bulk_unsuppress_profiles_jobs(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_suppression_bulk_delete_jobs(opts) +``` + + + + + +#### [Get Errors for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_errors_for_bulk_import_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_errors_for_bulk_import_profiles_job(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_bulk_profile_import_job_import_errors(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_bulk_import_job_import_errors(id, opts) +``` + + + + + +#### [Get List for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_for_bulk_import_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_list_for_bulk_import_profiles_job(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_bulk_profile_import_job_lists(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_bulk_import_job_lists(id, opts) +``` + + + + + +#### [Get List IDs for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_ids_for_bulk_import_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_list_ids_for_bulk_import_profiles_job(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_bulk_profile_import_job_relationships_lists(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_bulk_import_job_relationships_lists(id) +``` + + + + + +#### [Get List IDs for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_ids_for_profile) + +```ruby +KlaviyoAPI::Profiles.get_list_ids_for_profile(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_relationships_lists(id) +``` + + + + + +#### [Get Lists for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_lists_for_profile) + +```ruby +KlaviyoAPI::Profiles.get_lists_for_profile(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_lists(id, opts) +``` + + + + + +#### [Get Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile) + +```ruby +KlaviyoAPI::Profiles.get_profile(id, opts) +``` + + + + + +#### [Get Profile IDs for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_ids_for_bulk_import_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_profile_ids_for_bulk_import_profiles_job(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_bulk_profile_import_job_relationships_profiles(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_bulk_import_job_relationships_profiles(id, opts) +``` + + + + + +#### [Get Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profiles) + +```ruby +KlaviyoAPI::Profiles.get_profiles(opts) +``` + + + + + +#### [Get Profiles for Bulk Import Profiles Job](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profiles_for_bulk_import_profiles_job) + +```ruby +KlaviyoAPI::Profiles.get_profiles_for_bulk_import_profiles_job(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_bulk_profile_import_job_profiles(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_bulk_import_job_profiles(id, opts) +``` + + + + + +#### [Get Segment IDs for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_ids_for_profile) + +```ruby +KlaviyoAPI::Profiles.get_segment_ids_for_profile(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_relationships_segments(id) +``` + + + + + +#### [Get Segments for Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segments_for_profile) + +```ruby +KlaviyoAPI::Profiles.get_segments_for_profile(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.get_profile_segments(id, opts) +``` + + + + + +#### [Merge Profiles](https://developers.klaviyo.com/en/v2024-10-15/reference/merge_profiles) + +```ruby +KlaviyoAPI::Profiles.merge_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.create_profile_merge(body) +``` + + + + + +#### [Spawn Bulk Profile Import Job](https://developers.klaviyo.com/en/v2024-10-15/reference/spawn_bulk_profile_import_job) + +```ruby +KlaviyoAPI::Profiles.spawn_bulk_profile_import_job(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.bulk_import_profiles(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Profiles.create_profile_bulk_import_job(body) +``` + + + + + +#### [Update Profile](https://developers.klaviyo.com/en/v2024-10-15/reference/update_profile) + +```ruby +KlaviyoAPI::Profiles.update_profile(id, body) +``` + + + + + + +## Reporting + + +#### [Query Campaign Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_campaign_values) ```ruby -KlaviyoAPI::Profiles.get_bulk_profile_import_job_import_errors(id, opts) +KlaviyoAPI::Reporting.query_campaign_values(body, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.get_profile_bulk_import_job_import_errors(id, opts) +KlaviyoAPI::Reporting.create_campaign_value_report(body, opts) ``` -#### [Get Bulk Profile Import Job Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_lists) +#### [Query Flow Series](https://developers.klaviyo.com/en/v2024-10-15/reference/query_flow_series) ```ruby -KlaviyoAPI::Profiles.get_bulk_profile_import_job_lists(id, opts) +KlaviyoAPI::Reporting.query_flow_series(body, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.get_profile_bulk_import_job_lists(id, opts) +KlaviyoAPI::Reporting.create_flow_sery_report(body, opts) ``` -#### [Get Bulk Profile Import Job Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_profiles) +#### [Query Flow Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_flow_values) ```ruby -KlaviyoAPI::Profiles.get_bulk_profile_import_job_profiles(id, opts) +KlaviyoAPI::Reporting.query_flow_values(body, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.get_profile_bulk_import_job_profiles(id, opts) +KlaviyoAPI::Reporting.create_flow_value_report(body, opts) ``` -#### [Get Bulk Profile Import Job Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_relationships_lists) +#### [Query Form Series](https://developers.klaviyo.com/en/v2024-10-15/reference/query_form_series) ```ruby -KlaviyoAPI::Profiles.get_bulk_profile_import_job_relationships_lists(id) +KlaviyoAPI::Reporting.query_form_series(body) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.get_profile_bulk_import_job_relationships_lists(id) +KlaviyoAPI::Reporting.create_form_sery_report(body) ``` -#### [Get Bulk Profile Import Job Relationships Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_job_relationships_profiles) +#### [Query Form Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_form_values) ```ruby -KlaviyoAPI::Profiles.get_bulk_profile_import_job_relationships_profiles(id, opts) +KlaviyoAPI::Reporting.query_form_values(body) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.get_profile_bulk_import_job_relationships_profiles(id, opts) +KlaviyoAPI::Reporting.create_form_value_report(body) ``` -#### [Get Bulk Profile Import Jobs](https://developers.klaviyo.com/en/v2024-07-15/reference/get_bulk_profile_import_jobs) +#### [Query Segment Series](https://developers.klaviyo.com/en/v2024-10-15/reference/query_segment_series) ```ruby -KlaviyoAPI::Profiles.get_bulk_profile_import_jobs(opts) +KlaviyoAPI::Reporting.query_segment_series(body) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.get_profile_bulk_import_jobs(opts) +KlaviyoAPI::Reporting.create_segment_sery_report(body) ``` -#### [Get Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile) +#### [Query Segment Values](https://developers.klaviyo.com/en/v2024-10-15/reference/query_segment_values) ```ruby -KlaviyoAPI::Profiles.get_profile(id, opts) +KlaviyoAPI::Reporting.query_segment_values(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Reporting.create_segment_value_report(body) ``` -#### [Get Profile Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_lists) - -```ruby -KlaviyoAPI::Profiles.get_profile_lists(id, opts) -``` - - +## Reviews -#### [Get Profile Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_relationships_lists) +#### [Get Review](https://developers.klaviyo.com/en/v2024-10-15/reference/get_review) ```ruby -KlaviyoAPI::Profiles.get_profile_relationships_lists(id) +KlaviyoAPI::Reviews.get_review(id, opts) ``` -#### [Get Profile Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_relationships_segments) +#### [Get Reviews](https://developers.klaviyo.com/en/v2024-10-15/reference/get_reviews) ```ruby -KlaviyoAPI::Profiles.get_profile_relationships_segments(id) +KlaviyoAPI::Reviews.get_reviews(opts) ``` -#### [Get Profile Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profile_segments) - -```ruby -KlaviyoAPI::Profiles.get_profile_segments(id, opts) -``` - - +## Segments -#### [Get Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_profiles) +#### [Create Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/create_segment) ```ruby -KlaviyoAPI::Profiles.get_profiles(opts) +KlaviyoAPI::Segments.create_segment(body) ``` -#### [Merge Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/merge_profiles) +#### [Delete Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_segment) ```ruby -KlaviyoAPI::Profiles.merge_profiles(body) -``` -##### Method alias: -```ruby -KlaviyoAPI::Profiles.create_profile_merge(body) +KlaviyoAPI::Segments.delete_segment(id) ``` -#### [Spawn Bulk Profile Import Job](https://developers.klaviyo.com/en/v2024-07-15/reference/spawn_bulk_profile_import_job) +#### [Get Profile IDs for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profile_ids_for_segment) ```ruby -KlaviyoAPI::Profiles.spawn_bulk_profile_import_job(body) +KlaviyoAPI::Segments.get_profile_ids_for_segment(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.create_profile_bulk_import_job(body) +KlaviyoAPI::Segments.get_segment_relationships_profiles(id, opts) ``` -#### [Subscribe Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/subscribe_profiles) +#### [Get Profiles for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_profiles_for_segment) ```ruby -KlaviyoAPI::Profiles.subscribe_profiles(body) +KlaviyoAPI::Segments.get_profiles_for_segment(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Profiles.create_profile_subscription_bulk_create_job(body) +KlaviyoAPI::Segments.get_segment_profiles(id, opts) ``` -#### [Suppress Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/suppress_profiles) +#### [Get Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment) ```ruby -KlaviyoAPI::Profiles.suppress_profiles(body) -``` -##### Method alias: -```ruby -KlaviyoAPI::Profiles.create_profile_suppression_bulk_create_job(body) +KlaviyoAPI::Segments.get_segment(id, opts) ``` -#### [Unsubscribe Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/unsubscribe_profiles) +#### [Get Segment Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_flow_triggers) ```ruby -KlaviyoAPI::Profiles.unsubscribe_profiles(body) -``` -##### Method alias: -```ruby -KlaviyoAPI::Profiles.create_profile_subscription_bulk_delete_job(body) +KlaviyoAPI::Segments.get_segment_flow_triggers(id, opts) ``` -#### [Unsuppress Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/unsuppress_profiles) +#### [Get Segment Relationships Flow Triggers](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_relationships_flow_triggers) ```ruby -KlaviyoAPI::Profiles.unsuppress_profiles(body) -``` -##### Method alias: -```ruby -KlaviyoAPI::Profiles.create_profile_suppression_bulk_delete_job(body) +KlaviyoAPI::Segments.get_segment_relationships_flow_triggers(id) ``` -#### [Update Profile](https://developers.klaviyo.com/en/v2024-07-15/reference/update_profile) +#### [Get Segments](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segments) ```ruby -KlaviyoAPI::Profiles.update_profile(id, body) +KlaviyoAPI::Segments.get_segments(opts) ``` - -## Reporting - - -#### [Query Campaign Values](https://developers.klaviyo.com/en/v2024-07-15/reference/query_campaign_values) +#### [Get Tag IDs for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_segment) ```ruby -KlaviyoAPI::Reporting.query_campaign_values(body, opts) +KlaviyoAPI::Segments.get_tag_ids_for_segment(id) ``` ##### Method alias: ```ruby -KlaviyoAPI::Reporting.create_campaign_value_report(body, opts) +KlaviyoAPI::Segments.get_segment_relationships_tags(id) ``` -#### [Query Flow Series](https://developers.klaviyo.com/en/v2024-07-15/reference/query_flow_series) +#### [Get Tags for Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tags_for_segment) ```ruby -KlaviyoAPI::Reporting.query_flow_series(body, opts) +KlaviyoAPI::Segments.get_tags_for_segment(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Reporting.create_flow_sery_report(body, opts) +KlaviyoAPI::Segments.get_segment_tags(id, opts) ``` -#### [Query Flow Values](https://developers.klaviyo.com/en/v2024-07-15/reference/query_flow_values) +#### [Update Segment](https://developers.klaviyo.com/en/v2024-10-15/reference/update_segment) ```ruby -KlaviyoAPI::Reporting.query_flow_values(body, opts) -``` -##### Method alias: -```ruby -KlaviyoAPI::Reporting.create_flow_value_report(body, opts) +KlaviyoAPI::Segments.update_segment(id, body) ``` @@ -2539,201 +3207,207 @@ KlaviyoAPI::Reporting.create_flow_value_report(body, opts) -## Segments +## Tags -#### [Create Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/create_segment) +#### [Create Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/create_tag) ```ruby -KlaviyoAPI::Segments.create_segment(body) +KlaviyoAPI::Tags.create_tag(body) ``` -#### [Delete Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_segment) +#### [Create Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/create_tag_group) ```ruby -KlaviyoAPI::Segments.delete_segment(id) +KlaviyoAPI::Tags.create_tag_group(body) ``` -#### [Get Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment) +#### [Delete Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_tag) ```ruby -KlaviyoAPI::Segments.get_segment(id, opts) +KlaviyoAPI::Tags.delete_tag(id) ``` -#### [Get Segment Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_profiles) +#### [Delete Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_tag_group) ```ruby -KlaviyoAPI::Segments.get_segment_profiles(id, opts) +KlaviyoAPI::Tags.delete_tag_group(id) ``` -#### [Get Segment Relationships Profiles](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_relationships_profiles) +#### [Get Campaign IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_campaign_ids_for_tag) ```ruby -KlaviyoAPI::Segments.get_segment_relationships_profiles(id, opts) +KlaviyoAPI::Tags.get_campaign_ids_for_tag(id) ``` - - - - - -#### [Get Segment Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_relationships_tags) - +##### Method alias: ```ruby -KlaviyoAPI::Segments.get_segment_relationships_tags(id) +KlaviyoAPI::Tags.get_tag_relationships_campaigns(id) ``` -#### [Get Segment Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segment_tags) +#### [Get Flow IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_flow_ids_for_tag) ```ruby -KlaviyoAPI::Segments.get_segment_tags(id, opts) +KlaviyoAPI::Tags.get_flow_ids_for_tag(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.get_tag_relationships_flows(id) ``` -#### [Get Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_segments) +#### [Get List IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_list_ids_for_tag) ```ruby -KlaviyoAPI::Segments.get_segments(opts) +KlaviyoAPI::Tags.get_list_ids_for_tag(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.get_tag_relationships_lists(id) ``` -#### [Update Segment](https://developers.klaviyo.com/en/v2024-07-15/reference/update_segment) +#### [Get Segment IDs for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_segment_ids_for_tag) ```ruby -KlaviyoAPI::Segments.update_segment(id, body) +KlaviyoAPI::Tags.get_segment_ids_for_tag(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.get_tag_relationships_segments(id) ``` - -## Tags - - -#### [Create Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag) +#### [Get Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag) ```ruby -KlaviyoAPI::Tags.create_tag(body) +KlaviyoAPI::Tags.get_tag(id, opts) ``` -#### [Create Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_group) +#### [Get Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_group) ```ruby -KlaviyoAPI::Tags.create_tag_group(body) +KlaviyoAPI::Tags.get_tag_group(id, opts) ``` -#### [Create Tag Relationships Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_campaigns) +#### [Get Tag Group for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_group_for_tag) ```ruby -KlaviyoAPI::Tags.create_tag_relationships_campaigns(id, body) +KlaviyoAPI::Tags.get_tag_group_for_tag(id, opts) ``` ##### Method alias: ```ruby -KlaviyoAPI::Tags.create_tag_relationships_campaign(id, body) +KlaviyoAPI::Tags.get_tag_tag_group(id, opts) ``` -#### [Create Tag Relationships Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_flows) +#### [Get Tag Group ID for Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_group_id_for_tag) ```ruby -KlaviyoAPI::Tags.create_tag_relationships_flows(id, body) +KlaviyoAPI::Tags.get_tag_group_id_for_tag(id) ``` ##### Method alias: ```ruby -KlaviyoAPI::Tags.create_tag_relationships_flow(id, body) +KlaviyoAPI::Tags.get_tag_relationships_tag_group(id) ``` -#### [Create Tag Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_lists) +#### [Get Tag Groups](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_groups) ```ruby -KlaviyoAPI::Tags.create_tag_relationships_lists(id, body) -``` -##### Method alias: -```ruby -KlaviyoAPI::Tags.create_tag_relationships_list(id, body) +KlaviyoAPI::Tags.get_tag_groups(opts) ``` -#### [Create Tag Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/create_tag_relationships_segments) +#### [Get Tag IDs for Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tag_ids_for_tag_group) ```ruby -KlaviyoAPI::Tags.create_tag_relationships_segments(id, body) +KlaviyoAPI::Tags.get_tag_ids_for_tag_group(id) ``` ##### Method alias: ```ruby -KlaviyoAPI::Tags.create_tag_relationships_segment(id, body) +KlaviyoAPI::Tags.get_tag_group_relationships_tags(id) ``` -#### [Delete Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag) +#### [Get Tags](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tags) ```ruby -KlaviyoAPI::Tags.delete_tag(id) +KlaviyoAPI::Tags.get_tags(opts) ``` -#### [Delete Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_group) +#### [Get Tags for Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tags_for_tag_group) ```ruby -KlaviyoAPI::Tags.delete_tag_group(id) +KlaviyoAPI::Tags.get_tags_for_tag_group(id, opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.get_tag_group_tags(id, opts) ``` -#### [Delete Tag Relationships Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_campaigns) +#### [Remove Tag from Campaigns](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_campaigns) +```ruby +KlaviyoAPI::Tags.remove_tag_from_campaigns(id, body) +``` +##### Method alias: ```ruby KlaviyoAPI::Tags.delete_tag_relationships_campaigns(id, body) ``` @@ -2742,8 +3416,12 @@ KlaviyoAPI::Tags.delete_tag_relationships_campaigns(id, body) -#### [Delete Tag Relationships Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_flows) +#### [Remove Tag from Flows](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_flows) +```ruby +KlaviyoAPI::Tags.remove_tag_from_flows(id, body) +``` +##### Method alias: ```ruby KlaviyoAPI::Tags.delete_tag_relationships_flows(id, body) ``` @@ -2752,8 +3430,12 @@ KlaviyoAPI::Tags.delete_tag_relationships_flows(id, body) -#### [Delete Tag Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_lists) +#### [Remove Tag from Lists](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_lists) +```ruby +KlaviyoAPI::Tags.remove_tag_from_lists(id, body) +``` +##### Method alias: ```ruby KlaviyoAPI::Tags.delete_tag_relationships_lists(id, body) ``` @@ -2762,8 +3444,12 @@ KlaviyoAPI::Tags.delete_tag_relationships_lists(id, body) -#### [Delete Tag Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_tag_relationships_segments) +#### [Remove Tag from Segments](https://developers.klaviyo.com/en/v2024-10-15/reference/remove_tag_from_segments) +```ruby +KlaviyoAPI::Tags.remove_tag_from_segments(id, body) +``` +##### Method alias: ```ruby KlaviyoAPI::Tags.delete_tag_relationships_segments(id, body) ``` @@ -2772,214 +3458,274 @@ KlaviyoAPI::Tags.delete_tag_relationships_segments(id, body) -#### [Get Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag) +#### [Tag Campaigns](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_campaigns) ```ruby -KlaviyoAPI::Tags.get_tag(id, opts) +KlaviyoAPI::Tags.tag_campaigns(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_campaigns(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_campaign(id, body) ``` -#### [Get Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_group) +#### [Tag Flows](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_flows) ```ruby -KlaviyoAPI::Tags.get_tag_group(id, opts) +KlaviyoAPI::Tags.tag_flows(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_flows(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_flow(id, body) ``` -#### [Get Tag Group Relationships Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_group_relationships_tags) +#### [Tag Lists](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_lists) ```ruby -KlaviyoAPI::Tags.get_tag_group_relationships_tags(id) +KlaviyoAPI::Tags.tag_lists(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_lists(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_list(id, body) ``` -#### [Get Tag Group Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_group_tags) +#### [Tag Segments](https://developers.klaviyo.com/en/v2024-10-15/reference/tag_segments) ```ruby -KlaviyoAPI::Tags.get_tag_group_tags(id, opts) +KlaviyoAPI::Tags.tag_segments(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_segments(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Tags.create_tag_relationships_segment(id, body) ``` -#### [Get Tag Groups](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_groups) +#### [Update Tag](https://developers.klaviyo.com/en/v2024-10-15/reference/update_tag) ```ruby -KlaviyoAPI::Tags.get_tag_groups(opts) +KlaviyoAPI::Tags.update_tag(id, body) ``` -#### [Get Tag Relationships Campaigns](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_campaigns) +#### [Update Tag Group](https://developers.klaviyo.com/en/v2024-10-15/reference/update_tag_group) ```ruby -KlaviyoAPI::Tags.get_tag_relationships_campaigns(id) +KlaviyoAPI::Tags.update_tag_group(id, body) ``` -#### [Get Tag Relationships Flows](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_flows) + +## Templates + + +#### [Clone Template](https://developers.klaviyo.com/en/v2024-10-15/reference/clone_template) ```ruby -KlaviyoAPI::Tags.get_tag_relationships_flows(id) +KlaviyoAPI::Templates.clone_template(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Templates.create_template_clone(body) ``` -#### [Get Tag Relationships Lists](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_lists) +#### [Create Template](https://developers.klaviyo.com/en/v2024-10-15/reference/create_template) ```ruby -KlaviyoAPI::Tags.get_tag_relationships_lists(id) +KlaviyoAPI::Templates.create_template(body) ``` -#### [Get Tag Relationships Segments](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_segments) +#### [Create Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/create_universal_content) ```ruby -KlaviyoAPI::Tags.get_tag_relationships_segments(id) +KlaviyoAPI::Templates.create_universal_content(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Templates.create_template_universal_content(body) ``` -#### [Get Tag Relationships Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_relationships_tag_group) +#### [Delete Template](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_template) ```ruby -KlaviyoAPI::Tags.get_tag_relationships_tag_group(id) +KlaviyoAPI::Templates.delete_template(id) ``` -#### [Get Tag Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tag_tag_group) +#### [Delete Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_universal_content) ```ruby -KlaviyoAPI::Tags.get_tag_tag_group(id, opts) +KlaviyoAPI::Templates.delete_universal_content(id) +``` +##### Method alias: +```ruby +KlaviyoAPI::Templates.delete_template_universal_content(id) ``` -#### [Get Tags](https://developers.klaviyo.com/en/v2024-07-15/reference/get_tags) +#### [Get All Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/get_all_universal_content) ```ruby -KlaviyoAPI::Tags.get_tags(opts) +KlaviyoAPI::Templates.get_all_universal_content(opts) +``` +##### Method alias: +```ruby +KlaviyoAPI::Templates.get_template_universal_content(opts) ``` -#### [Update Tag](https://developers.klaviyo.com/en/v2024-07-15/reference/update_tag) +#### [Get Template](https://developers.klaviyo.com/en/v2024-10-15/reference/get_template) ```ruby -KlaviyoAPI::Tags.update_tag(id, body) +KlaviyoAPI::Templates.get_template(id, opts) ``` -#### [Update Tag Group](https://developers.klaviyo.com/en/v2024-07-15/reference/update_tag_group) +#### [Get Templates](https://developers.klaviyo.com/en/v2024-10-15/reference/get_templates) ```ruby -KlaviyoAPI::Tags.update_tag_group(id, body) +KlaviyoAPI::Templates.get_templates(opts) ``` - -## Templates - - -#### [Create Template](https://developers.klaviyo.com/en/v2024-07-15/reference/create_template) +#### [Get Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/get_universal_content) ```ruby -KlaviyoAPI::Templates.create_template(body) +KlaviyoAPI::Templates.get_universal_content(id, opts) ``` -#### [Create Template Clone](https://developers.klaviyo.com/en/v2024-07-15/reference/create_template_clone) +#### [Render Template](https://developers.klaviyo.com/en/v2024-10-15/reference/render_template) ```ruby -KlaviyoAPI::Templates.create_template_clone(body) +KlaviyoAPI::Templates.render_template(body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Templates.create_template_render(body) ``` -#### [Create Template Render](https://developers.klaviyo.com/en/v2024-07-15/reference/create_template_render) +#### [Update Template](https://developers.klaviyo.com/en/v2024-10-15/reference/update_template) ```ruby -KlaviyoAPI::Templates.create_template_render(body) +KlaviyoAPI::Templates.update_template(id, body) ``` -#### [Delete Template](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_template) +#### [Update Universal Content](https://developers.klaviyo.com/en/v2024-10-15/reference/update_universal_content) ```ruby -KlaviyoAPI::Templates.delete_template(id) +KlaviyoAPI::Templates.update_universal_content(id, body) +``` +##### Method alias: +```ruby +KlaviyoAPI::Templates.update_template_universal_content(id, body) ``` -#### [Get Template](https://developers.klaviyo.com/en/v2024-07-15/reference/get_template) + +## Tracking Settings + + +#### [Get Tracking Setting](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tracking_setting) ```ruby -KlaviyoAPI::Templates.get_template(id, opts) +KlaviyoAPI::TrackingSettings.get_tracking_setting(id, opts) ``` -#### [Get Templates](https://developers.klaviyo.com/en/v2024-07-15/reference/get_templates) +#### [Get Tracking Settings](https://developers.klaviyo.com/en/v2024-10-15/reference/get_tracking_settings) ```ruby -KlaviyoAPI::Templates.get_templates(opts) +KlaviyoAPI::TrackingSettings.get_tracking_settings(opts) ``` -#### [Update Template](https://developers.klaviyo.com/en/v2024-07-15/reference/update_template) +#### [Update Tracking Setting](https://developers.klaviyo.com/en/v2024-10-15/reference/update_tracking_setting) ```ruby -KlaviyoAPI::Templates.update_template(id, body) +KlaviyoAPI::TrackingSettings.update_tracking_setting(id, body) ``` @@ -2990,7 +3736,7 @@ KlaviyoAPI::Templates.update_template(id, body) ## Webhooks -#### [Create Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/create_webhook) +#### [Create Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/create_webhook) ```ruby KlaviyoAPI::Webhooks.create_webhook(body) @@ -3000,7 +3746,7 @@ KlaviyoAPI::Webhooks.create_webhook(body) -#### [Delete Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/delete_webhook) +#### [Delete Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/delete_webhook) ```ruby KlaviyoAPI::Webhooks.delete_webhook(id) @@ -3010,7 +3756,7 @@ KlaviyoAPI::Webhooks.delete_webhook(id) -#### [Get Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhook) +#### [Get Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhook) ```ruby KlaviyoAPI::Webhooks.get_webhook(id, opts) @@ -3020,7 +3766,7 @@ KlaviyoAPI::Webhooks.get_webhook(id, opts) -#### [Get Webhook Topic](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhook_topic) +#### [Get Webhook Topic](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhook_topic) ```ruby KlaviyoAPI::Webhooks.get_webhook_topic(id) @@ -3030,7 +3776,7 @@ KlaviyoAPI::Webhooks.get_webhook_topic(id) -#### [Get Webhook Topics](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhook_topics) +#### [Get Webhook Topics](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhook_topics) ```ruby KlaviyoAPI::Webhooks.get_webhook_topics @@ -3040,7 +3786,7 @@ KlaviyoAPI::Webhooks.get_webhook_topics -#### [Get Webhooks](https://developers.klaviyo.com/en/v2024-07-15/reference/get_webhooks) +#### [Get Webhooks](https://developers.klaviyo.com/en/v2024-10-15/reference/get_webhooks) ```ruby KlaviyoAPI::Webhooks.get_webhooks(opts) @@ -3050,7 +3796,7 @@ KlaviyoAPI::Webhooks.get_webhooks(opts) -#### [Update Webhook](https://developers.klaviyo.com/en/v2024-07-15/reference/update_webhook) +#### [Update Webhook](https://developers.klaviyo.com/en/v2024-10-15/reference/update_webhook) ```ruby KlaviyoAPI::Webhooks.update_webhook(id, body) diff --git a/klaviyo-api-sdk.gemspec b/klaviyo-api-sdk.gemspec index 018d5e3..470b01e 100644 --- a/klaviyo-api-sdk.gemspec +++ b/klaviyo-api-sdk.gemspec @@ -5,7 +5,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -17,7 +17,7 @@ require "klaviyo-api-sdk/version" Gem::Specification.new do |s| s.name = "klaviyo-api-sdk" - s.version = "9.0.0" + s.version = "10.0.0" s.authors = ['Klaviyo Team'] s.email = ['libraries@klaviyo.com'] s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API' diff --git a/lib/klaviyo-api-sdk.rb b/lib/klaviyo-api-sdk.rb index 5f286de..030b096 100644 --- a/lib/klaviyo-api-sdk.rb +++ b/lib/klaviyo-api-sdk.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -28,6 +28,8 @@ require 'klaviyo-api-sdk/models/back_in_stock_subscription_enum' require 'klaviyo-api-sdk/models/base_event_create_query_resource_object' require 'klaviyo-api-sdk/models/base_event_create_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/block_display_options' +require 'klaviyo-api-sdk/models/block_enum' require 'klaviyo-api-sdk/models/boolean_enum' require 'klaviyo-api-sdk/models/boolean_filter' require 'klaviyo-api-sdk/models/bounce_date_enum' @@ -70,6 +72,8 @@ require 'klaviyo-api-sdk/models/campaign_send_job_partial_update_query' require 'klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object' require 'klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/campaign_tracking_setting_dynamic_param' +require 'klaviyo-api-sdk/models/campaign_tracking_setting_static_param' require 'klaviyo-api-sdk/models/campaign_values_report_enum' require 'klaviyo-api-sdk/models/campaign_values_request_dto' require 'klaviyo-api-sdk/models/campaign_values_request_dto_resource_object' @@ -164,6 +168,7 @@ require 'klaviyo-api-sdk/models/constant_contact_enum' require 'klaviyo-api-sdk/models/constant_contact_integration_filter' require 'klaviyo-api-sdk/models/constant_contact_integration_method_filter' +require 'klaviyo-api-sdk/models/content_repeat' require 'klaviyo-api-sdk/models/coupon_code_bulk_create_job_enum' require 'klaviyo-api-sdk/models/coupon_code_create_job_create_query' require 'klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object' @@ -189,6 +194,7 @@ require 'klaviyo-api-sdk/models/custom_source_enum' require 'klaviyo-api-sdk/models/custom_source_filter' require 'klaviyo-api-sdk/models/custom_timeframe' +require 'klaviyo-api-sdk/models/custom_tracking_param_dto' require 'klaviyo-api-sdk/models/data_privacy_create_deletion_job_query' require 'klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object' require 'klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes' @@ -199,11 +205,14 @@ require 'klaviyo-api-sdk/models/date_enum' require 'klaviyo-api-sdk/models/device_metadata' require 'klaviyo-api-sdk/models/double_optin_filter' +require 'klaviyo-api-sdk/models/dynamic_enum' +require 'klaviyo-api-sdk/models/dynamic_tracking_param' require 'klaviyo-api-sdk/models/email_content_sub_object' require 'klaviyo-api-sdk/models/email_enum' require 'klaviyo-api-sdk/models/email_send_options_sub_object' require 'klaviyo-api-sdk/models/email_subscription_parameters' require 'klaviyo-api-sdk/models/email_tracking_options_sub_object' +require 'klaviyo-api-sdk/models/email_tracking_options_sub_object_custom_tracking_params_inner' require 'klaviyo-api-sdk/models/equals_enum' require 'klaviyo-api-sdk/models/equals_string_filter' require 'klaviyo-api-sdk/models/event_bulk_create_enum' @@ -233,6 +242,8 @@ require 'klaviyo-api-sdk/models/flow_series_request_dto' require 'klaviyo-api-sdk/models/flow_series_request_dto_resource_object' require 'klaviyo-api-sdk/models/flow_series_request_dto_resource_object_attributes' +require 'klaviyo-api-sdk/models/flow_tracking_setting_dynamic_param' +require 'klaviyo-api-sdk/models/flow_tracking_setting_static_param' require 'klaviyo-api-sdk/models/flow_update_query' require 'klaviyo-api-sdk/models/flow_update_query_resource_object' require 'klaviyo-api-sdk/models/flow_update_query_resource_object_attributes' @@ -242,10 +253,20 @@ require 'klaviyo-api-sdk/models/flow_values_request_dto_resource_object_attributes' require 'klaviyo-api-sdk/models/form_enum' require 'klaviyo-api-sdk/models/form_method_filter' +require 'klaviyo-api-sdk/models/form_series_report_enum' +require 'klaviyo-api-sdk/models/form_series_request_dto' +require 'klaviyo-api-sdk/models/form_series_request_dto_resource_object' +require 'klaviyo-api-sdk/models/form_series_request_dto_resource_object_attributes' +require 'klaviyo-api-sdk/models/form_values_report_enum' +require 'klaviyo-api-sdk/models/form_values_request_dto' +require 'klaviyo-api-sdk/models/form_values_request_dto_resource_object' +require 'klaviyo-api-sdk/models/form_values_request_dto_resource_object_attributes' require 'klaviyo-api-sdk/models/get_accounts4_xx_response' require 'klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner' require 'klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner_source' require 'klaviyo-api-sdk/models/greater_than_enum' +require 'klaviyo-api-sdk/models/html_block' +require 'klaviyo-api-sdk/models/html_block_data' require 'klaviyo-api-sdk/models/has_email_marketing' require 'klaviyo-api-sdk/models/has_email_marketing_consent' require 'klaviyo-api-sdk/models/has_email_marketing_consent_consent_status' @@ -257,6 +278,7 @@ require 'klaviyo-api-sdk/models/has_sms_marketing_consent' require 'klaviyo-api-sdk/models/has_sms_marketing_subscribed' require 'klaviyo-api-sdk/models/has_sms_marketing_subscribed_filters_inner' +require 'klaviyo-api-sdk/models/html_enum' require 'klaviyo-api-sdk/models/image_create_query' require 'klaviyo-api-sdk/models/image_create_query_resource_object' require 'klaviyo-api-sdk/models/image_create_query_resource_object_attributes' @@ -288,6 +310,7 @@ require 'klaviyo-api-sdk/models/list_partial_update_query' require 'klaviyo-api-sdk/models/list_partial_update_query_resource_object' require 'klaviyo-api-sdk/models/list_set_filter' +require 'klaviyo-api-sdk/models/list_substring_filter' require 'klaviyo-api-sdk/models/mailbox_provider_enum' require 'klaviyo-api-sdk/models/mailbox_provider_method_filter' require 'klaviyo-api-sdk/models/manual_add_enum' @@ -298,7 +321,6 @@ require 'klaviyo-api-sdk/models/manual_remove_method_filter' require 'klaviyo-api-sdk/models/manual_suppression_date_enum' require 'klaviyo-api-sdk/models/manual_suppression_date_filter' -require 'klaviyo-api-sdk/models/marketing_subscription_parameters' require 'klaviyo-api-sdk/models/message_blocked_enum' require 'klaviyo-api-sdk/models/message_blocked_method_filter' require 'klaviyo-api-sdk/models/method_enum' @@ -434,6 +456,15 @@ require 'klaviyo-api-sdk/models/segment_partial_update_query' require 'klaviyo-api-sdk/models/segment_partial_update_query_resource_object' require 'klaviyo-api-sdk/models/segment_partial_update_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/segment_series_report_enum' +require 'klaviyo-api-sdk/models/segment_series_request_dto' +require 'klaviyo-api-sdk/models/segment_series_request_dto_resource_object' +require 'klaviyo-api-sdk/models/segment_series_request_dto_resource_object_attributes' +require 'klaviyo-api-sdk/models/segment_values_report_enum' +require 'klaviyo-api-sdk/models/segment_values_request_dto' +require 'klaviyo-api-sdk/models/segment_values_request_dto_resource_object' +require 'klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes' +require 'klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes_timeframe' require 'klaviyo-api-sdk/models/send_strategy_sub_object' require 'klaviyo-api-sdk/models/server_bis_subscription_create_query' require 'klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object' @@ -452,7 +483,9 @@ require 'klaviyo-api-sdk/models/spam_complaint_method_filter' require 'klaviyo-api-sdk/models/static_date_filter' require 'klaviyo-api-sdk/models/static_date_range_filter' +require 'klaviyo-api-sdk/models/static_enum' require 'klaviyo-api-sdk/models/static_schedule_options' +require 'klaviyo-api-sdk/models/static_tracking_param' require 'klaviyo-api-sdk/models/status_date_enum' require 'klaviyo-api-sdk/models/status_date_filter' require 'klaviyo-api-sdk/models/status_date_filter_filter' @@ -476,6 +509,7 @@ require 'klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships' require 'klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list' require 'klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list_data' +require 'klaviyo-api-sdk/models/subscription_parameters' require 'klaviyo-api-sdk/models/suppression_create_job_create_query' require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object' require 'klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes' @@ -528,14 +562,33 @@ require 'klaviyo-api-sdk/models/template_render_query' require 'klaviyo-api-sdk/models/template_render_query_resource_object' require 'klaviyo-api-sdk/models/template_render_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/template_universal_content_enum' require 'klaviyo-api-sdk/models/template_update_query' require 'klaviyo-api-sdk/models/template_update_query_resource_object' require 'klaviyo-api-sdk/models/template_update_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/text_block' +require 'klaviyo-api-sdk/models/text_block_data' +require 'klaviyo-api-sdk/models/text_block_styles' +require 'klaviyo-api-sdk/models/text_enum' require 'klaviyo-api-sdk/models/throttled_schedule_options' require 'klaviyo-api-sdk/models/timeframe' -require 'klaviyo-api-sdk/models/utm_params_sub_object' +require 'klaviyo-api-sdk/models/tracking_param_dto' +require 'klaviyo-api-sdk/models/tracking_param_dto_campaign' +require 'klaviyo-api-sdk/models/tracking_param_dto_flow' +require 'klaviyo-api-sdk/models/tracking_setting_enum' +require 'klaviyo-api-sdk/models/tracking_setting_partial_update_query' +require 'klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object' +require 'klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object_attributes' require 'klaviyo-api-sdk/models/union_positive_numeric_filter' require 'klaviyo-api-sdk/models/union_positive_numeric_filter_operator' +require 'klaviyo-api-sdk/models/universal_content_create_query' +require 'klaviyo-api-sdk/models/universal_content_create_query_resource_object' +require 'klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes_definition' +require 'klaviyo-api-sdk/models/universal_content_partial_update_query' +require 'klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object' +require 'klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes' +require 'klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes_definition' require 'klaviyo-api-sdk/models/unsubscribed_enum' require 'klaviyo-api-sdk/models/webhook_create_query' require 'klaviyo-api-sdk/models/webhook_create_query_resource_object' @@ -563,9 +616,11 @@ require 'klaviyo-api-sdk/api/metrics_api' require 'klaviyo-api-sdk/api/profiles_api' require 'klaviyo-api-sdk/api/reporting_api' +require 'klaviyo-api-sdk/api/reviews_api' require 'klaviyo-api-sdk/api/segments_api' require 'klaviyo-api-sdk/api/tags_api' require 'klaviyo-api-sdk/api/templates_api' +require 'klaviyo-api-sdk/api/tracking_settings_api' require 'klaviyo-api-sdk/api/webhooks_api' # retry logic diff --git a/lib/klaviyo-api-sdk/api/accounts_api.rb b/lib/klaviyo-api-sdk/api/accounts_api.rb index 9b6af3c..f1a23ba 100644 --- a/lib/klaviyo-api-sdk/api/accounts_api.rb +++ b/lib/klaviyo-api-sdk/api/accounts_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -23,7 +23,7 @@ def initialize(api_client = ApiClient.default) # Retrieve a single account object by its account ID. You can only request the account by which the private API key was generated.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `accounts:read` # @param id [String] The ID of the account # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_account(id, opts = {}) data, _status_code, _headers = get_account_with_http_info(id, opts) @@ -34,7 +34,7 @@ def get_account(id, opts = {}) # Retrieve a single account object by its account ID. You can only request the account by which the private API key was generated.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # @param id [String] The ID of the account # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_account_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -49,7 +49,7 @@ def get_account_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_account\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/accounts/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/accounts/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -58,9 +58,9 @@ def get_account_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -94,7 +94,7 @@ def get_account_with_http_info(id, opts = {}) # Get Accounts # Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `accounts:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_accounts(opts = {}) data, _status_code, _headers = get_accounts_with_http_info(opts) @@ -104,7 +104,7 @@ def get_accounts(opts = {}) # Get Accounts # Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array. You can use this to retrieve account-specific data (contact information, timezone, currency, Public API key, etc.) or test if a Private API Key belongs to the correct account prior to performing subsequent actions with the API.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `accounts:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_account For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_accounts_with_http_info(opts = {}) if @api_client.config.debugging @@ -115,7 +115,7 @@ def get_accounts_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"fields_account\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/accounts/' + local_var_path = '/api/accounts' # query parameters query_params = opts[:query_params] || {} @@ -124,9 +124,9 @@ def get_accounts_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} diff --git a/lib/klaviyo-api-sdk/api/campaigns_api.rb b/lib/klaviyo-api-sdk/api/campaigns_api.rb index 0237072..8798ca7 100644 --- a/lib/klaviyo-api-sdk/api/campaigns_api.rb +++ b/lib/klaviyo-api-sdk/api/campaigns_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -19,31 +19,34 @@ class CampaignsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Campaign - # Creates a campaign given a set of parameters, then returns it.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_create_query [CampaignCreateQuery] Creates a campaign from parameters + # Assign Template to Campaign Message + # Creates a non-reusable version of the template and assigns it to the message.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_message_assign_template_query [CampaignMessageAssignTemplateQuery] Takes a reusable template, clones it, and assigns the non-reusable clone to the message. # @param [Hash] opts the optional parameters # @return [Hash] - def create_campaign(campaign_create_query, opts = {}) - data, _status_code, _headers = create_campaign_with_http_info(campaign_create_query, opts) + def assign_template_to_campaign_message(campaign_message_assign_template_query, opts = {}) + data, _status_code, _headers = assign_template_to_campaign_message_with_http_info(campaign_message_assign_template_query, opts) data end - # Create Campaign - # Creates a campaign given a set of parameters, then returns it.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_create_query [CampaignCreateQuery] Creates a campaign from parameters + # alias of `assign_template_to_campaign_message` + alias create_campaign_message_assign_template assign_template_to_campaign_message + + # Assign Template to Campaign Message + # Creates a non-reusable version of the template and assigns it to the message.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_message_assign_template_query [CampaignMessageAssignTemplateQuery] Takes a reusable template, clones it, and assigns the non-reusable clone to the message. # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_campaign_with_http_info(campaign_create_query, opts = {}) + def assign_template_to_campaign_message_with_http_info(campaign_message_assign_template_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.assign_template_to_campaign_message ...' end - # verify the required parameter 'campaign_create_query' is set - if @api_client.config.client_side_validation && campaign_create_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_create_query' when calling CampaignsApi.create_campaign" + # verify the required parameter 'campaign_message_assign_template_query' is set + if @api_client.config.client_side_validation && campaign_message_assign_template_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_message_assign_template_query' when calling CampaignsApi.assign_template_to_campaign_message" end # resource path - local_var_path = '/api/campaigns/' + local_var_path = '/api/campaign-message-assign-template' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +54,11 @@ def create_campaign_with_http_info(campaign_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -64,7 +67,7 @@ def create_campaign_with_http_info(campaign_create_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_message_assign_template_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -73,7 +76,7 @@ def create_campaign_with_http_info(campaign_create_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.create_campaign", + :operation => :"CampaignsApi.assign_template_to_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -84,106 +87,48 @@ def create_campaign_with_http_info(campaign_create_query, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#assign_template_to_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Campaign Clone - # Clones an existing campaign, returning a new campaign based on the original with a new ID and name.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_clone_query [CampaignCloneQuery] Clones a campaign from an existing campaign - # @param [Hash] opts the optional parameters - # @return [Hash] - def create_campaign_clone(campaign_clone_query, opts = {}) - data, _status_code, _headers = create_campaign_clone_with_http_info(campaign_clone_query, opts) - data - end + # alias of `assign_template_to_campaign_message_with_http_info` + alias create_campaign_message_assign_template_with_http_info assign_template_to_campaign_message_with_http_info - # Create Campaign Clone - # Clones an existing campaign, returning a new campaign based on the original with a new ID and name.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_clone_query [CampaignCloneQuery] Clones a campaign from an existing campaign + # Cancel Campaign Send + # Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param id [String] The ID of the currently sending campaign to cancel or revert + # @param campaign_send_job_partial_update_query [CampaignSendJobPartialUpdateQuery] Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_campaign_clone_with_http_info(campaign_clone_query, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_clone ...' - end - # verify the required parameter 'campaign_clone_query' is set - if @api_client.config.client_side_validation && campaign_clone_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_clone_query' when calling CampaignsApi.create_campaign_clone" - end - # resource path - local_var_path = '/api/campaign-clone/' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_clone_query) - - # return_type - return_type = opts[:debug_return_type] || 'Hash' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] - - new_options = opts.merge( - :operation => :"CampaignsApi.create_campaign_clone", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#create_campaign_clone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers + # @return [nil] + def cancel_campaign_send(id, campaign_send_job_partial_update_query, opts = {}) + cancel_campaign_send_with_http_info(id, campaign_send_job_partial_update_query, opts) + nil end - # Assign Campaign Message Template - # Creates a non-reusable version of the template and assigns it to the message.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_message_assign_template_query [CampaignMessageAssignTemplateQuery] Takes a reusable template, clones it, and assigns the non-reusable clone to the message. - # @param [Hash] opts the optional parameters - # @return [Hash] - def create_campaign_message_assign_template(campaign_message_assign_template_query, opts = {}) - data, _status_code, _headers = create_campaign_message_assign_template_with_http_info(campaign_message_assign_template_query, opts) - data - end + # alias of `cancel_campaign_send` + alias update_campaign_send_job cancel_campaign_send - # Assign Campaign Message Template - # Creates a non-reusable version of the template and assigns it to the message.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_message_assign_template_query [CampaignMessageAssignTemplateQuery] Takes a reusable template, clones it, and assigns the non-reusable clone to the message. + # Cancel Campaign Send + # Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param id [String] The ID of the currently sending campaign to cancel or revert + # @param campaign_send_job_partial_update_query [CampaignSendJobPartialUpdateQuery] Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_campaign_message_assign_template_with_http_info(campaign_message_assign_template_query, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def cancel_campaign_send_with_http_info(id, campaign_send_job_partial_update_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_message_assign_template ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.cancel_campaign_send ...' end - # verify the required parameter 'campaign_message_assign_template_query' is set - if @api_client.config.client_side_validation && campaign_message_assign_template_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_message_assign_template_query' when calling CampaignsApi.create_campaign_message_assign_template" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.cancel_campaign_send" + end + # verify the required parameter 'campaign_send_job_partial_update_query' is set + if @api_client.config.client_side_validation && campaign_send_job_partial_update_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_send_job_partial_update_query' when calling CampaignsApi.cancel_campaign_send" end # resource path - local_var_path = '/api/campaign-message-assign-template/' + local_var_path = '/api/campaign-send-jobs/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -191,11 +136,11 @@ def create_campaign_message_assign_template_with_http_info(campaign_message_assi # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -204,16 +149,16 @@ def create_campaign_message_assign_template_with_http_info(campaign_message_assi form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_message_assign_template_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_send_job_partial_update_query) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.create_campaign_message_assign_template", + :operation => :"CampaignsApi.cancel_campaign_send", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -222,38 +167,41 @@ def create_campaign_message_assign_template_with_http_info(campaign_message_assi :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#create_campaign_message_assign_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#cancel_campaign_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Campaign Recipient Estimation Job - # Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_recipient_estimation_job_create_query [CampaignRecipientEstimationJobCreateQuery] Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. + # alias of `cancel_campaign_send_with_http_info` + alias update_campaign_send_job_with_http_info cancel_campaign_send_with_http_info + + # Create Campaign + # Creates a campaign given a set of parameters, then returns it.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_create_query [CampaignCreateQuery] Creates a campaign from parameters # @param [Hash] opts the optional parameters # @return [Hash] - def create_campaign_recipient_estimation_job(campaign_recipient_estimation_job_create_query, opts = {}) - data, _status_code, _headers = create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_estimation_job_create_query, opts) + def create_campaign(campaign_create_query, opts = {}) + data, _status_code, _headers = create_campaign_with_http_info(campaign_create_query, opts) data end - # Create Campaign Recipient Estimation Job - # Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_recipient_estimation_job_create_query [CampaignRecipientEstimationJobCreateQuery] Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. + # Create Campaign + # Creates a campaign given a set of parameters, then returns it.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_create_query [CampaignCreateQuery] Creates a campaign from parameters # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_estimation_job_create_query, opts = {}) + def create_campaign_with_http_info(campaign_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_recipient_estimation_job ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign ...' end - # verify the required parameter 'campaign_recipient_estimation_job_create_query' is set - if @api_client.config.client_side_validation && campaign_recipient_estimation_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_recipient_estimation_job_create_query' when calling CampaignsApi.create_campaign_recipient_estimation_job" + # verify the required parameter 'campaign_create_query' is set + if @api_client.config.client_side_validation && campaign_create_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_create_query' when calling CampaignsApi.create_campaign" end # resource path - local_var_path = '/api/campaign-recipient-estimation-jobs/' + local_var_path = '/api/campaigns' # query parameters query_params = opts[:query_params] || {} @@ -261,11 +209,11 @@ def create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_e # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -274,7 +222,7 @@ def create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_e form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_recipient_estimation_job_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -283,7 +231,7 @@ def create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_e auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.create_campaign_recipient_estimation_job", + :operation => :"CampaignsApi.create_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -294,36 +242,39 @@ def create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_e data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#create_campaign_recipient_estimation_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Campaign Send Job - # Trigger a campaign to send asynchronously

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_send_job_create_query [CampaignSendJobCreateQuery] Trigger the campaign to send asynchronously + # Create Campaign Clone + # Clones an existing campaign, returning a new campaign based on the original with a new ID and name.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_clone_query [CampaignCloneQuery] Clones a campaign from an existing campaign # @param [Hash] opts the optional parameters # @return [Hash] - def create_campaign_send_job(campaign_send_job_create_query, opts = {}) - data, _status_code, _headers = create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts) + def create_campaign_clone(campaign_clone_query, opts = {}) + data, _status_code, _headers = create_campaign_clone_with_http_info(campaign_clone_query, opts) data end - # Create Campaign Send Job - # Trigger a campaign to send asynchronously<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param campaign_send_job_create_query [CampaignSendJobCreateQuery] Trigger the campaign to send asynchronously + # alias of `create_campaign_clone` + alias clone_campaign create_campaign_clone + + # Create Campaign Clone + # Clones an existing campaign, returning a new campaign based on the original with a new ID and name.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_clone_query [CampaignCloneQuery] Clones a campaign from an existing campaign # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts = {}) + def create_campaign_clone_with_http_info(campaign_clone_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_send_job ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_clone ...' end - # verify the required parameter 'campaign_send_job_create_query' is set - if @api_client.config.client_side_validation && campaign_send_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_send_job_create_query' when calling CampaignsApi.create_campaign_send_job" + # verify the required parameter 'campaign_clone_query' is set + if @api_client.config.client_side_validation && campaign_clone_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_clone_query' when calling CampaignsApi.create_campaign_clone" end # resource path - local_var_path = '/api/campaign-send-jobs/' + local_var_path = '/api/campaign-clone' # query parameters query_params = opts[:query_params] || {} @@ -331,11 +282,11 @@ def create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -344,7 +295,7 @@ def create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_send_job_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_clone_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -353,7 +304,7 @@ def create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.create_campaign_send_job", + :operation => :"CampaignsApi.create_campaign_clone", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -364,11 +315,14 @@ def create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#create_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#create_campaign_clone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `create_campaign_clone_with_http_info` + alias clone_campaign_with_http_info create_campaign_clone_with_http_info + # Delete Campaign # Delete a campaign with the given campaign ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` # @param id [String] The campaign ID to be deleted @@ -393,7 +347,7 @@ def delete_campaign_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.delete_campaign" end # resource path - local_var_path = '/api/campaigns/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -401,9 +355,9 @@ def delete_campaign_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -438,10 +392,10 @@ def delete_campaign_with_http_info(id, opts = {}) # Returns a specific campaign based on a required id.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] The campaign ID to be retrieved # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_campaign(id, opts = {}) data, _status_code, _headers = get_campaign_with_http_info(id, opts) @@ -452,10 +406,10 @@ def get_campaign(id, opts = {}) # Returns a specific campaign based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] The campaign ID to be retrieved # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_campaign_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -465,11 +419,11 @@ def get_campaign_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign" end - allowable_values = ["label", "channel", "content", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] + allowable_values = ["label", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" end - allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "tracking_options", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] + allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "tracking_options", "tracking_options.add_tracking_params", "tracking_options.custom_tracking_params", "tracking_options.is_tracking_clicks", "tracking_options.is_tracking_opens", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" end @@ -482,7 +436,7 @@ def get_campaign_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaigns/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -494,9 +448,9 @@ def get_campaign_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -527,69 +481,51 @@ def get_campaign_with_http_info(id, opts = {}) return data, status_code, headers end - # Get Campaign Campaign Messages - # Return all messages that belong to the given campaign.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # Get Campaign for Campaign Message + # Return the related campaign

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_campaign_messages(id, opts = {}) - data, _status_code, _headers = get_campaign_campaign_messages_with_http_info(id, opts) + def get_campaign_for_campaign_message(id, opts = {}) + data, _status_code, _headers = get_campaign_for_campaign_message_with_http_info(id, opts) data end - # Get Campaign Campaign Messages - # Return all messages that belong to the given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # alias of `get_campaign_for_campaign_message` + alias get_campaign_message_campaign get_campaign_for_campaign_message + + # Get Campaign for Campaign Message + # Return the related campaign<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_campaign_messages_with_http_info(id, opts = {}) + def get_campaign_for_campaign_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_campaign_messages ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_for_campaign_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_campaign_messages" - end - allowable_values = ["label", "channel", "content", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] - if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_for_campaign_message" end - allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "tracking_options", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] + allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "tracking_options", "tracking_options.add_tracking_params", "tracking_options.custom_tracking_params", "tracking_options.is_tracking_clicks", "tracking_options.is_tracking_opens", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" end - allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" - end - allowable_values = ["campaign", "template"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" - end # resource path - local_var_path = '/api/campaigns/{id}/campaign-messages/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-messages/{id}/campaign'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil? query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil? - query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -604,7 +540,7 @@ def get_campaign_campaign_messages_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_campaign_messages", + :operation => :"CampaignsApi.get_campaign_for_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -615,74 +551,52 @@ def get_campaign_campaign_messages_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_campaign_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_for_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Message - # Returns a specific message based on a required id.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The message ID to be retrieved + # alias of `get_campaign_for_campaign_message_with_http_info` + alias get_campaign_message_campaign_with_http_info get_campaign_for_campaign_message_with_http_info + + # Get Campaign ID for Campaign Message + # Returns the ID of the related campaign

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships # @return [Hash] - def get_campaign_message(id, opts = {}) - data, _status_code, _headers = get_campaign_message_with_http_info(id, opts) + def get_campaign_id_for_campaign_message(id, opts = {}) + data, _status_code, _headers = get_campaign_id_for_campaign_message_with_http_info(id, opts) data end - # Get Campaign Message - # Returns a specific message based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The message ID to be retrieved + # alias of `get_campaign_id_for_campaign_message` + alias get_campaign_message_relationships_campaign get_campaign_id_for_campaign_message + + # Get Campaign ID for Campaign Message + # Returns the ID of the related campaign<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_message_with_http_info(id, opts = {}) + def get_campaign_id_for_campaign_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_id_for_campaign_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message" - end - allowable_values = ["label", "channel", "content", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] - if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" - end - allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "tracking_options", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] - if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" - end - allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" - end - allowable_values = ["campaign", "template"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_id_for_campaign_message" end # resource path - local_var_path = '/api/campaign-messages/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-messages/{id}/relationships/campaign'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil? - query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil? - query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -697,7 +611,7 @@ def get_campaign_message_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_message", + :operation => :"CampaignsApi.get_campaign_id_for_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -708,53 +622,77 @@ def get_campaign_message_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_id_for_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Message Campaign - # Return the related campaign

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] + # alias of `get_campaign_id_for_campaign_message_with_http_info` + alias get_campaign_message_relationships_campaign_with_http_info get_campaign_id_for_campaign_message_with_http_info + + # Get Campaign Message + # Returns a specific message based on a required id.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The message ID to be retrieved # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_campaign_message_campaign(id, opts = {}) - data, _status_code, _headers = get_campaign_message_campaign_with_http_info(id, opts) + def get_campaign_message(id, opts = {}) + data, _status_code, _headers = get_campaign_message_with_http_info(id, opts) data end - # Get Campaign Message Campaign - # Return the related campaign<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] + # Get Campaign Message + # Returns a specific message based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The message ID to be retrieved # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_message_campaign_with_http_info(id, opts = {}) + def get_campaign_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message_campaign ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message_campaign" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message" + end + allowable_values = ["label", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] + if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" end - allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "tracking_options", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] + allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "tracking_options", "tracking_options.add_tracking_params", "tracking_options.custom_tracking_params", "tracking_options.is_tracking_clicks", "tracking_options.is_tracking_opens", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" end + allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" + end + allowable_values = ["campaign", "template"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end # resource path - local_var_path = '/api/campaign-messages/{id}/campaign/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-messages/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil? query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil? + query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -769,7 +707,7 @@ def get_campaign_message_campaign_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_message_campaign", + :operation => :"CampaignsApi.get_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -780,46 +718,53 @@ def get_campaign_message_campaign_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Message Relationships Campaign - # Returns the ID of the related campaign

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] + # Get Campaign Recipient Estimation + # Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using the `Create Campaign Recipient Estimation Job` endpoint.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The ID of the campaign for which to get the estimated number of recipients # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_message_relationships_campaign(id, opts = {}) - data, _status_code, _headers = get_campaign_message_relationships_campaign_with_http_info(id, opts) + def get_campaign_recipient_estimation(id, opts = {}) + data, _status_code, _headers = get_campaign_recipient_estimation_with_http_info(id, opts) data end - # Get Campaign Message Relationships Campaign - # Returns the ID of the related campaign<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] + # Get Campaign Recipient Estimation + # Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The ID of the campaign for which to get the estimated number of recipients # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_message_relationships_campaign_with_http_info(id, opts = {}) + def get_campaign_recipient_estimation_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message_relationships_campaign ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_recipient_estimation ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message_relationships_campaign" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_recipient_estimation" + end + allowable_values = ["estimated_recipient_count"] + if @api_client.config.client_side_validation && opts[:'fields_campaign_recipient_estimation'] && !opts[:'fields_campaign_recipient_estimation'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign_recipient_estimation\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaign-messages/{id}/relationships/campaign/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-recipient-estimations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[campaign-recipient-estimation]'] = @api_client.build_collection_param(opts[:'fields_campaign_recipient_estimation'], :csv) if !opts[:'fields_campaign_recipient_estimation'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -834,7 +779,7 @@ def get_campaign_message_relationships_campaign_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_message_relationships_campaign", + :operation => :"CampaignsApi.get_campaign_recipient_estimation", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -845,46 +790,53 @@ def get_campaign_message_relationships_campaign_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message_relationships_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_recipient_estimation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Message Relationships Template - # Returns the ID of the related template

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` - # @param id [String] + # Get Campaign Recipient Estimation Job + # Retrieve the status of a recipient estimation job triggered with the `Create Campaign Recipient Estimation Job` endpoint.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The ID of the campaign to get recipient estimation status # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_message_relationships_template(id, opts = {}) - data, _status_code, _headers = get_campaign_message_relationships_template_with_http_info(id, opts) + def get_campaign_recipient_estimation_job(id, opts = {}) + data, _status_code, _headers = get_campaign_recipient_estimation_job_with_http_info(id, opts) data end - # Get Campaign Message Relationships Template - # Returns the ID of the related template<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` - # @param id [String] + # Get Campaign Recipient Estimation Job + # Retrieve the status of a recipient estimation job triggered with the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The ID of the campaign to get recipient estimation status # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_message_relationships_template_with_http_info(id, opts = {}) + def get_campaign_recipient_estimation_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message_relationships_template ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_recipient_estimation_job ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message_relationships_template" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_recipient_estimation_job" + end + allowable_values = ["status"] + if @api_client.config.client_side_validation && opts[:'fields_campaign_recipient_estimation_job'] && !opts[:'fields_campaign_recipient_estimation_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign_recipient_estimation_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaign-messages/{id}/relationships/template/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-recipient-estimation-jobs/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[campaign-recipient-estimation-job]'] = @api_client.build_collection_param(opts[:'fields_campaign_recipient_estimation_job'], :csv) if !opts[:'fields_campaign_recipient_estimation_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -899,7 +851,7 @@ def get_campaign_message_relationships_template_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_message_relationships_template", + :operation => :"CampaignsApi.get_campaign_recipient_estimation_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -910,53 +862,53 @@ def get_campaign_message_relationships_template_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message_relationships_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_recipient_estimation_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Message Template - # Return the related template

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` - # @param id [String] + # Get Campaign Send Job + # Get a campaign send job

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The ID of the campaign to send # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_message_template(id, opts = {}) - data, _status_code, _headers = get_campaign_message_template_with_http_info(id, opts) + def get_campaign_send_job(id, opts = {}) + data, _status_code, _headers = get_campaign_send_job_with_http_info(id, opts) data end - # Get Campaign Message Template - # Return the related template<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` - # @param id [String] + # Get Campaign Send Job + # Get a campaign send job<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # @param id [String] The ID of the campaign to send # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_message_template_with_http_info(id, opts = {}) + def get_campaign_send_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message_template ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_send_job ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message_template" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_send_job" end - allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" + allowable_values = ["status"] + if @api_client.config.client_side_validation && opts[:'fields_campaign_send_job'] && !opts[:'fields_campaign_send_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign_send_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaign-messages/{id}/template/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-send-jobs/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? + query_params[:'fields[campaign-send-job]'] = @api_client.build_collection_param(opts[:'fields_campaign_send_job'], :csv) if !opts[:'fields_campaign_send_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -971,7 +923,7 @@ def get_campaign_message_template_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_message_template", + :operation => :"CampaignsApi.get_campaign_send_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -982,53 +934,53 @@ def get_campaign_message_template_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Recipient Estimation - # Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using the `Create Campaign Recipient Estimation Job` endpoint.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The ID of the campaign for which to get the estimated number of recipients + # Get Campaign Tags + # Return all tags that belong to the given campaign.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_recipient_estimation(id, opts = {}) - data, _status_code, _headers = get_campaign_recipient_estimation_with_http_info(id, opts) + def get_campaign_tags(id, opts = {}) + data, _status_code, _headers = get_campaign_tags_with_http_info(id, opts) data end - # Get Campaign Recipient Estimation - # Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The ID of the campaign for which to get the estimated number of recipients + # Get Campaign Tags + # Return all tags that belong to the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_recipient_estimation_with_http_info(id, opts = {}) + def get_campaign_tags_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_recipient_estimation ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_tags ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_recipient_estimation" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_tags" end - allowable_values = ["estimated_recipient_count"] - if @api_client.config.client_side_validation && opts[:'fields_campaign_recipient_estimation'] && !opts[:'fields_campaign_recipient_estimation'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign_recipient_estimation\", must include one of #{allowable_values}" + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaign-recipient-estimations/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[campaign-recipient-estimation]'] = @api_client.build_collection_param(opts[:'fields_campaign_recipient_estimation'], :csv) if !opts[:'fields_campaign_recipient_estimation'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1043,7 +995,7 @@ def get_campaign_recipient_estimation_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_recipient_estimation", + :operation => :"CampaignsApi.get_campaign_tags", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1054,53 +1006,85 @@ def get_campaign_recipient_estimation_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_recipient_estimation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Recipient Estimation Job - # Retrieve the status of a recipient estimation job triggered with the `Create Campaign Recipient Estimation Job` endpoint.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The ID of the campaign to get recipient estimation status + # Get Campaigns + # Returns some or all campaigns based on filters. A channel filter is required to list campaigns. Please provide either: `?filter=equals(messages.channel,'email')` to list email campaigns, or `?filter=equals(messages.channel,'sms')` to list SMS campaigns.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` + # @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_campaign_recipient_estimation_job(id, opts = {}) - data, _status_code, _headers = get_campaign_recipient_estimation_job_with_http_info(id, opts) + def get_campaigns(filter, opts = {}) + data, _status_code, _headers = get_campaigns_with_http_info(filter, opts) data end - # Get Campaign Recipient Estimation Job - # Retrieve the status of a recipient estimation job triggered with the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The ID of the campaign to get recipient estimation status + # Get Campaigns + # Returns some or all campaigns based on filters. A channel filter is required to list campaigns. Please provide either: `?filter=equals(messages.channel,'email')` to list email campaigns, or `?filter=equals(messages.channel,'sms')` to list SMS campaigns.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` + # @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_recipient_estimation_job_with_http_info(id, opts = {}) + def get_campaigns_with_http_info(filter, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_recipient_estimation_job ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaigns ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_recipient_estimation_job" + # verify the required parameter 'filter' is set + if @api_client.config.client_side_validation && filter.nil? + fail ArgumentError, "Missing the required parameter 'filter' when calling CampaignsApi.get_campaigns" end - allowable_values = ["status"] - if @api_client.config.client_side_validation && opts[:'fields_campaign_recipient_estimation_job'] && !opts[:'fields_campaign_recipient_estimation_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign_recipient_estimation_job\", must include one of #{allowable_values}" + allowable_values = ["label", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] + if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" + end + allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "tracking_options", "tracking_options.add_tracking_params", "tracking_options.custom_tracking_params", "tracking_options.is_tracking_clicks", "tracking_options.is_tracking_opens", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] + if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + end + allowable_values = ["campaign-messages", "tags"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + allowable_values = ["created_at", "-created_at", "id", "-id", "name", "-name", "scheduled_at", "-scheduled_at", "updated_at", "-updated_at"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/campaign-recipient-estimation-jobs/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[campaign-recipient-estimation-job]'] = @api_client.build_collection_param(opts[:'fields_campaign_recipient_estimation_job'], :csv) if !opts[:'fields_campaign_recipient_estimation_job'].nil? + query_params[:'filter'] = filter + query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil? + query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1115,7 +1099,7 @@ def get_campaign_recipient_estimation_job_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_recipient_estimation_job", + :operation => :"CampaignsApi.get_campaigns", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1126,36 +1110,39 @@ def get_campaign_recipient_estimation_job_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_recipient_estimation_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Relationships Campaign Messages + # Get Message IDs for Campaign # Returns the IDs of all messages associated with the given campaign.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] # @param [Hash] opts the optional parameters # @return [Hash] - def get_campaign_relationships_campaign_messages(id, opts = {}) - data, _status_code, _headers = get_campaign_relationships_campaign_messages_with_http_info(id, opts) + def get_message_ids_for_campaign(id, opts = {}) + data, _status_code, _headers = get_message_ids_for_campaign_with_http_info(id, opts) data end - # Get Campaign Relationships Campaign Messages + # alias of `get_message_ids_for_campaign` + alias get_campaign_relationships_campaign_messages get_message_ids_for_campaign + + # Get Message IDs for Campaign # Returns the IDs of all messages associated with the given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_relationships_campaign_messages_with_http_info(id, opts = {}) + def get_message_ids_for_campaign_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_relationships_campaign_messages ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_message_ids_for_campaign ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_relationships_campaign_messages" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_message_ids_for_campaign" end # resource path - local_var_path = '/api/campaigns/{id}/relationships/campaign-messages/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}/relationships/campaign-messages'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1163,9 +1150,9 @@ def get_campaign_relationships_campaign_messages_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1180,7 +1167,7 @@ def get_campaign_relationships_campaign_messages_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_relationships_campaign_messages", + :operation => :"CampaignsApi.get_message_ids_for_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1191,46 +1178,80 @@ def get_campaign_relationships_campaign_messages_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_relationships_campaign_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_message_ids_for_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Relationships Tags - # Returns the IDs of all tags associated with the given campaign.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # alias of `get_message_ids_for_campaign_with_http_info` + alias get_campaign_relationships_campaign_messages_with_http_info get_message_ids_for_campaign_with_http_info + + # Get Messages for Campaign + # Return all messages that belong to the given campaign.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_campaign_relationships_tags(id, opts = {}) - data, _status_code, _headers = get_campaign_relationships_tags_with_http_info(id, opts) + def get_messages_for_campaign(id, opts = {}) + data, _status_code, _headers = get_messages_for_campaign_with_http_info(id, opts) data end - # Get Campaign Relationships Tags - # Returns the IDs of all tags associated with the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # alias of `get_messages_for_campaign` + alias get_campaign_campaign_messages get_messages_for_campaign + + # Get Messages for Campaign + # Return all messages that belong to the given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_relationships_tags_with_http_info(id, opts = {}) + def get_messages_for_campaign_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_relationships_tags ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_messages_for_campaign ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_relationships_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_messages_for_campaign" + end + allowable_values = ["label", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] + if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" + end + allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "tracking_options", "tracking_options.add_tracking_params", "tracking_options.custom_tracking_params", "tracking_options.is_tracking_clicks", "tracking_options.is_tracking_opens", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] + if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" + end + allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" + end + allowable_values = ["campaign", "template"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaigns/{id}/relationships/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}/campaign-messages'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil? + query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil? + query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1245,7 +1266,7 @@ def get_campaign_relationships_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_relationships_tags", + :operation => :"CampaignsApi.get_messages_for_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1256,53 +1277,52 @@ def get_campaign_relationships_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_relationships_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_messages_for_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Send Job - # Get a campaign send job

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The ID of the campaign to send + # alias of `get_messages_for_campaign_with_http_info` + alias get_campaign_campaign_messages_with_http_info get_messages_for_campaign_with_http_info + + # Get Tag IDs for Campaign + # Returns the IDs of all tags associated with the given campaign.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_send_job(id, opts = {}) - data, _status_code, _headers = get_campaign_send_job_with_http_info(id, opts) + def get_tag_ids_for_campaign(id, opts = {}) + data, _status_code, _headers = get_tag_ids_for_campaign_with_http_info(id, opts) data end - # Get Campaign Send Job - # Get a campaign send job<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param id [String] The ID of the campaign to send + # alias of `get_tag_ids_for_campaign` + alias get_campaign_relationships_tags get_tag_ids_for_campaign + + # Get Tag IDs for Campaign + # Returns the IDs of all tags associated with the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_send_job_with_http_info(id, opts = {}) + def get_tag_ids_for_campaign_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_send_job ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_tag_ids_for_campaign ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_send_job" - end - allowable_values = ["status"] - if @api_client.config.client_side_validation && opts[:'fields_campaign_send_job'] && !opts[:'fields_campaign_send_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign_send_job\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_tag_ids_for_campaign" end # resource path - local_var_path = '/api/campaign-send-jobs/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}/relationships/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[campaign-send-job]'] = @api_client.build_collection_param(opts[:'fields_campaign_send_job'], :csv) if !opts[:'fields_campaign_send_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1317,7 +1337,7 @@ def get_campaign_send_job_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_send_job", + :operation => :"CampaignsApi.get_tag_ids_for_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1328,53 +1348,59 @@ def get_campaign_send_job_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_tag_ids_for_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaign Tags - # Return all tags that belong to the given campaign.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # alias of `get_tag_ids_for_campaign_with_http_info` + alias get_campaign_relationships_tags_with_http_info get_tag_ids_for_campaign_with_http_info + + # Get Template for Campaign Message + # Return the related template

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_campaign_tags(id, opts = {}) - data, _status_code, _headers = get_campaign_tags_with_http_info(id, opts) + def get_template_for_campaign_message(id, opts = {}) + data, _status_code, _headers = get_template_for_campaign_message_with_http_info(id, opts) data end - # Get Campaign Tags - # Return all tags that belong to the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # alias of `get_template_for_campaign_message` + alias get_campaign_message_template get_template_for_campaign_message + + # Get Template for Campaign Message + # Return the related template<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaign_tags_with_http_info(id, opts = {}) + def get_template_for_campaign_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_tags ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_template_for_campaign_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_template_for_campaign_message" end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/campaigns/{id}/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-messages/{id}/template'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1389,7 +1415,7 @@ def get_campaign_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaign_tags", + :operation => :"CampaignsApi.get_template_for_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1400,85 +1426,52 @@ def get_campaign_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaign_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_template_for_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Campaigns - # Returns some or all campaigns based on filters. A channel filter is required to list campaigns. Please provide either: `?filter=equals(messages.channel,'email')` to list email campaigns, or `?filter=equals(messages.channel,'sms')` to list SMS campaigns.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` - # @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # alias of `get_template_for_campaign_message_with_http_info` + alias get_campaign_message_template_with_http_info get_template_for_campaign_message_with_http_info + + # Get Template ID for Campaign Message + # Returns the ID of the related template

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Hash] - def get_campaigns(filter, opts = {}) - data, _status_code, _headers = get_campaigns_with_http_info(filter, opts) + def get_template_id_for_campaign_message(id, opts = {}) + data, _status_code, _headers = get_template_id_for_campaign_message_with_http_info(id, opts) data end - # Get Campaigns - # Returns some or all campaigns based on filters. A channel filter is required to list campaigns. Please provide either: `?filter=equals(messages.channel,'email')` to list email campaigns, or `?filter=equals(messages.channel,'sms')` to list SMS campaigns.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` - # @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`messages.channel`: `equals`<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # alias of `get_template_id_for_campaign_message` + alias get_campaign_message_relationships_template get_template_id_for_campaign_message + + # Get Template ID for Campaign Message + # Returns the ID of the related template<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:read` `templates:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_campaigns_with_http_info(filter, opts = {}) + def get_template_id_for_campaign_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaigns ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.get_template_id_for_campaign_message ...' end - # verify the required parameter 'filter' is set - if @api_client.config.client_side_validation && filter.nil? - fail ArgumentError, "Missing the required parameter 'filter' when calling CampaignsApi.get_campaigns" - end - allowable_values = ["label", "channel", "content", "send_times", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language", "created_at", "updated_at"] - if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}" - end - allowable_values = ["name", "status", "archived", "audiences", "audiences.included", "audiences.excluded", "send_options", "tracking_options", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"] - if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}" - end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" - end - allowable_values = ["campaign-messages", "tags"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" - end - allowable_values = ["created_at", "-created_at", "id", "-id", "name", "-name", "scheduled_at", "-scheduled_at", "updated_at", "-updated_at"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_template_id_for_campaign_message" end # resource path - local_var_path = '/api/campaigns/' + local_var_path = '/api/campaign-messages/{id}/relationships/template'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'filter'] = filter - query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil? - query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil? - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1493,7 +1486,7 @@ def get_campaigns_with_http_info(filter, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.get_campaigns", + :operation => :"CampaignsApi.get_template_id_for_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1504,42 +1497,118 @@ def get_campaigns_with_http_info(filter, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#get_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#get_template_id_for_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update Campaign - # Update a campaign with the given campaign ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param id [String] The campaign ID to be retrieved - # @param campaign_partial_update_query [CampaignPartialUpdateQuery] Update a campaign and return it + # alias of `get_template_id_for_campaign_message_with_http_info` + alias get_campaign_message_relationships_template_with_http_info get_template_id_for_campaign_message_with_http_info + + # Refresh Campaign Recipient Estimation + # Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_recipient_estimation_job_create_query [CampaignRecipientEstimationJobCreateQuery] Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. # @param [Hash] opts the optional parameters # @return [Hash] - def update_campaign(id, campaign_partial_update_query, opts = {}) - data, _status_code, _headers = update_campaign_with_http_info(id, campaign_partial_update_query, opts) + def refresh_campaign_recipient_estimation(campaign_recipient_estimation_job_create_query, opts = {}) + data, _status_code, _headers = refresh_campaign_recipient_estimation_with_http_info(campaign_recipient_estimation_job_create_query, opts) data end - # Update Campaign - # Update a campaign with the given campaign ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param id [String] The campaign ID to be retrieved - # @param campaign_partial_update_query [CampaignPartialUpdateQuery] Update a campaign and return it + # alias of `refresh_campaign_recipient_estimation` + alias create_campaign_recipient_estimation_job refresh_campaign_recipient_estimation + + # Refresh Campaign Recipient Estimation + # Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_recipient_estimation_job_create_query [CampaignRecipientEstimationJobCreateQuery] Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign. # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {}) + def refresh_campaign_recipient_estimation_with_http_info(campaign_recipient_estimation_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.refresh_campaign_recipient_estimation ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign" + # verify the required parameter 'campaign_recipient_estimation_job_create_query' is set + if @api_client.config.client_side_validation && campaign_recipient_estimation_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_recipient_estimation_job_create_query' when calling CampaignsApi.refresh_campaign_recipient_estimation" end - # verify the required parameter 'campaign_partial_update_query' is set - if @api_client.config.client_side_validation && campaign_partial_update_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_partial_update_query' when calling CampaignsApi.update_campaign" + # resource path + local_var_path = '/api/campaign-recipient-estimation-jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_recipient_estimation_job_create_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"CampaignsApi.refresh_campaign_recipient_estimation", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CampaignsApi#refresh_campaign_recipient_estimation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `refresh_campaign_recipient_estimation_with_http_info` + alias create_campaign_recipient_estimation_job_with_http_info refresh_campaign_recipient_estimation_with_http_info + + # Send Campaign + # Trigger a campaign to send asynchronously

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_send_job_create_query [CampaignSendJobCreateQuery] Trigger the campaign to send asynchronously + # @param [Hash] opts the optional parameters + # @return [Hash] + def send_campaign(campaign_send_job_create_query, opts = {}) + data, _status_code, _headers = send_campaign_with_http_info(campaign_send_job_create_query, opts) + data + end + + # alias of `send_campaign` + alias create_campaign_send_job send_campaign + + # Send Campaign + # Trigger a campaign to send asynchronously<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param campaign_send_job_create_query [CampaignSendJobCreateQuery] Trigger the campaign to send asynchronously + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def send_campaign_with_http_info(campaign_send_job_create_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CampaignsApi.send_campaign ...' + end + # verify the required parameter 'campaign_send_job_create_query' is set + if @api_client.config.client_side_validation && campaign_send_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_send_job_create_query' when calling CampaignsApi.send_campaign" end # resource path - local_var_path = '/api/campaigns/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-send-jobs' # query parameters query_params = opts[:query_params] || {} @@ -1547,11 +1616,11 @@ def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1560,7 +1629,7 @@ def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_partial_update_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_send_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -1569,7 +1638,7 @@ def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.update_campaign", + :operation => :"CampaignsApi.send_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1578,44 +1647,47 @@ def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#send_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update Campaign Message - # Update a campaign message

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param id [String] The message ID to be retrieved - # @param campaign_message_partial_update_query [CampaignMessagePartialUpdateQuery] Update a message and return it + # alias of `send_campaign_with_http_info` + alias create_campaign_send_job_with_http_info send_campaign_with_http_info + + # Update Campaign + # Update a campaign with the given campaign ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param id [String] The campaign ID to be retrieved + # @param campaign_partial_update_query [CampaignPartialUpdateQuery] Update a campaign and return it # @param [Hash] opts the optional parameters # @return [Hash] - def update_campaign_message(id, campaign_message_partial_update_query, opts = {}) - data, _status_code, _headers = update_campaign_message_with_http_info(id, campaign_message_partial_update_query, opts) + def update_campaign(id, campaign_partial_update_query, opts = {}) + data, _status_code, _headers = update_campaign_with_http_info(id, campaign_partial_update_query, opts) data end - # Update Campaign Message - # Update a campaign message<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param id [String] The message ID to be retrieved - # @param campaign_message_partial_update_query [CampaignMessagePartialUpdateQuery] Update a message and return it + # Update Campaign + # Update a campaign with the given campaign ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param id [String] The campaign ID to be retrieved + # @param campaign_partial_update_query [CampaignPartialUpdateQuery] Update a campaign and return it # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def update_campaign_message_with_http_info(id, campaign_message_partial_update_query, opts = {}) + def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign_message ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign_message" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign" end - # verify the required parameter 'campaign_message_partial_update_query' is set - if @api_client.config.client_side_validation && campaign_message_partial_update_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_message_partial_update_query' when calling CampaignsApi.update_campaign_message" + # verify the required parameter 'campaign_partial_update_query' is set + if @api_client.config.client_side_validation && campaign_partial_update_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_partial_update_query' when calling CampaignsApi.update_campaign" end # resource path - local_var_path = '/api/campaign-messages/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1623,11 +1695,11 @@ def update_campaign_message_with_http_info(id, campaign_message_partial_update_q # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1636,7 +1708,7 @@ def update_campaign_message_with_http_info(id, campaign_message_partial_update_q form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_message_partial_update_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_partial_update_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -1645,7 +1717,7 @@ def update_campaign_message_with_http_info(id, campaign_message_partial_update_q auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.update_campaign_message", + :operation => :"CampaignsApi.update_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1656,42 +1728,42 @@ def update_campaign_message_with_http_info(id, campaign_message_partial_update_q data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#update_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update Campaign Send Job - # Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` - # @param id [String] The ID of the currently sending campaign to cancel or revert - # @param campaign_send_job_partial_update_query [CampaignSendJobPartialUpdateQuery] Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT + # Update Campaign Message + # Update a campaign message

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `campaigns:write` + # @param id [String] The message ID to be retrieved + # @param campaign_message_partial_update_query [CampaignMessagePartialUpdateQuery] Update a message and return it # @param [Hash] opts the optional parameters - # @return [nil] - def update_campaign_send_job(id, campaign_send_job_partial_update_query, opts = {}) - update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update_query, opts) - nil + # @return [Hash] + def update_campaign_message(id, campaign_message_partial_update_query, opts = {}) + data, _status_code, _headers = update_campaign_message_with_http_info(id, campaign_message_partial_update_query, opts) + data end - # Update Campaign Send Job - # Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` - # @param id [String] The ID of the currently sending campaign to cancel or revert - # @param campaign_send_job_partial_update_query [CampaignSendJobPartialUpdateQuery] Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT + # Update Campaign Message + # Update a campaign message<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `campaigns:write` + # @param id [String] The message ID to be retrieved + # @param campaign_message_partial_update_query [CampaignMessagePartialUpdateQuery] Update a message and return it # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update_query, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def update_campaign_message_with_http_info(id, campaign_message_partial_update_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign_send_job ...' + @api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign_send_job" + fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign_message" end - # verify the required parameter 'campaign_send_job_partial_update_query' is set - if @api_client.config.client_side_validation && campaign_send_job_partial_update_query.nil? - fail ArgumentError, "Missing the required parameter 'campaign_send_job_partial_update_query' when calling CampaignsApi.update_campaign_send_job" + # verify the required parameter 'campaign_message_partial_update_query' is set + if @api_client.config.client_side_validation && campaign_message_partial_update_query.nil? + fail ArgumentError, "Missing the required parameter 'campaign_message_partial_update_query' when calling CampaignsApi.update_campaign_message" end # resource path - local_var_path = '/api/campaign-send-jobs/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/campaign-messages/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1699,11 +1771,11 @@ def update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1712,16 +1784,16 @@ def update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_send_job_partial_update_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_message_partial_update_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CampaignsApi.update_campaign_send_job", + :operation => :"CampaignsApi.update_campaign_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1732,7 +1804,7 @@ def update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CampaignsApi#update_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CampaignsApi#update_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/lib/klaviyo-api-sdk/api/catalogs_api.rb b/lib/klaviyo-api-sdk/api/catalogs_api.rb index a742162..cf757b4 100644 --- a/lib/klaviyo-api-sdk/api/catalogs_api.rb +++ b/lib/klaviyo-api-sdk/api/catalogs_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -19,31 +19,43 @@ class CatalogsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Back In Stock Subscription - # Subscribe a profile to receive back in stock notifications. Check out [our Back in Stock API guide](https://developers.klaviyo.com/en/docs/how_to_set_up_custom_back_in_stock) for more details. This endpoint is specifically designed to be called from server-side applications. To create subscriptions from client-side contexts, use [POST /client/back-in-stock-subscriptions](https://developers.klaviyo.com/en/reference/create_client_back_in_stock_subscription).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:write` `profiles:write` - # @param server_bis_subscription_create_query [ServerBISSubscriptionCreateQuery] + # Add Category to Catalog Item + # Create a new catalog category relationship for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [nil] - def create_back_in_stock_subscription(server_bis_subscription_create_query, opts = {}) - create_back_in_stock_subscription_with_http_info(server_bis_subscription_create_query, opts) + def add_category_to_catalog_item(id, catalog_item_category_op, opts = {}) + add_category_to_catalog_item_with_http_info(id, catalog_item_category_op, opts) nil end - # Create Back In Stock Subscription - # Subscribe a profile to receive back in stock notifications. Check out [our Back in Stock API guide](https://developers.klaviyo.com/en/docs/how_to_set_up_custom_back_in_stock) for more details. This endpoint is specifically designed to be called from server-side applications. To create subscriptions from client-side contexts, use [POST /client/back-in-stock-subscriptions](https://developers.klaviyo.com/en/reference/create_client_back_in_stock_subscription).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:write` `profiles:write` - # @param server_bis_subscription_create_query [ServerBISSubscriptionCreateQuery] + # alias of `add_category_to_catalog_item` + alias create_catalog_item_relationships_categories add_category_to_catalog_item + + # alias of `add_category_to_catalog_item` + alias create_catalog_item_relationships_category add_category_to_catalog_item + + # Add Category to Catalog Item + # Create a new catalog category relationship for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_back_in_stock_subscription_with_http_info(server_bis_subscription_create_query, opts = {}) + def add_category_to_catalog_item_with_http_info(id, catalog_item_category_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.create_back_in_stock_subscription ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.add_category_to_catalog_item ...' end - # verify the required parameter 'server_bis_subscription_create_query' is set - if @api_client.config.client_side_validation && server_bis_subscription_create_query.nil? - fail ArgumentError, "Missing the required parameter 'server_bis_subscription_create_query' when calling CatalogsApi.create_back_in_stock_subscription" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.add_category_to_catalog_item" + end + # verify the required parameter 'catalog_item_category_op' is set + if @api_client.config.client_side_validation && catalog_item_category_op.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.add_category_to_catalog_item" end # resource path - local_var_path = '/api/back-in-stock-subscriptions/' + local_var_path = '/api/catalog-items/{id}/relationships/categories'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -51,11 +63,11 @@ def create_back_in_stock_subscription_with_http_info(server_bis_subscription_cre # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -64,7 +76,7 @@ def create_back_in_stock_subscription_with_http_info(server_bis_subscription_cre form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(server_bis_subscription_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) # return_type return_type = opts[:debug_return_type] @@ -73,7 +85,7 @@ def create_back_in_stock_subscription_with_http_info(server_bis_subscription_cre auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.create_back_in_stock_subscription", + :operation => :"CatalogsApi.add_category_to_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -84,36 +96,54 @@ def create_back_in_stock_subscription_with_http_info(server_bis_subscription_cre data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#create_back_in_stock_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#add_category_to_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Catalog Category - # Create a new catalog category.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_create_query [CatalogCategoryCreateQuery] + # alias of `add_category_to_catalog_item_with_http_info` + alias create_catalog_item_relationships_categories_with_http_info add_category_to_catalog_item_with_http_info + + # alias of `add_category_to_catalog_item_with_http_info` + alias create_catalog_item_relationships_category_with_http_info add_category_to_catalog_item_with_http_info + + # Add Items to Catalog Category + # Create a new item relationship for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def create_catalog_category(catalog_category_create_query, opts = {}) - data, _status_code, _headers = create_catalog_category_with_http_info(catalog_category_create_query, opts) - data + # @return [nil] + def add_items_to_catalog_category(id, catalog_category_item_op, opts = {}) + add_items_to_catalog_category_with_http_info(id, catalog_category_item_op, opts) + nil end - # Create Catalog Category - # Create a new catalog category.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_create_query [CatalogCategoryCreateQuery] + # alias of `add_items_to_catalog_category` + alias create_catalog_category_relationships_items add_items_to_catalog_category + + # alias of `add_items_to_catalog_category` + alias create_catalog_category_relationships_item add_items_to_catalog_category + + # Add Items to Catalog Category + # Create a new item relationship for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_catalog_category_with_http_info(catalog_category_create_query, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def add_items_to_catalog_category_with_http_info(id, catalog_category_item_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_category ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.add_items_to_catalog_category ...' end - # verify the required parameter 'catalog_category_create_query' is set - if @api_client.config.client_side_validation && catalog_category_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_create_query' when calling CatalogsApi.create_catalog_category" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.add_items_to_catalog_category" + end + # verify the required parameter 'catalog_category_item_op' is set + if @api_client.config.client_side_validation && catalog_category_item_op.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.add_items_to_catalog_category" end # resource path - local_var_path = '/api/catalog-categories/' + local_var_path = '/api/catalog-categories/{id}/relationships/items'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -121,11 +151,11 @@ def create_catalog_category_with_http_info(catalog_category_create_query, opts = # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -134,16 +164,16 @@ def create_catalog_category_with_http_info(catalog_category_create_query, opts = form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.create_catalog_category", + :operation => :"CatalogsApi.add_items_to_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -154,45 +184,48 @@ def create_catalog_category_with_http_info(catalog_category_create_query, opts = data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#add_items_to_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Catalog Category Relationships Items - # Create a new item relationship for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_category_item_op [CatalogCategoryItemOp] + # alias of `add_items_to_catalog_category_with_http_info` + alias create_catalog_category_relationships_items_with_http_info add_items_to_catalog_category_with_http_info + + # alias of `add_items_to_catalog_category_with_http_info` + alias create_catalog_category_relationships_item_with_http_info add_items_to_catalog_category_with_http_info + + # Bulk Create Catalog Categories + # Create a catalog category bulk create job to create a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_create_job_create_query [CatalogCategoryCreateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def create_catalog_category_relationships_items(id, catalog_category_item_op, opts = {}) - create_catalog_category_relationships_items_with_http_info(id, catalog_category_item_op, opts) - nil + # @return [Hash] + def bulk_create_catalog_categories(catalog_category_create_job_create_query, opts = {}) + data, _status_code, _headers = bulk_create_catalog_categories_with_http_info(catalog_category_create_job_create_query, opts) + data end - # alias of `create_catalog_category_relationships_items` - alias create_catalog_category_relationships_item create_catalog_category_relationships_items + # alias of `bulk_create_catalog_categories` + alias spawn_create_categories_job bulk_create_catalog_categories - # Create Catalog Category Relationships Items - # Create a new item relationship for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_category_item_op [CatalogCategoryItemOp] + # alias of `bulk_create_catalog_categories` + alias create_catalog_category_bulk_create_job bulk_create_catalog_categories + + # Bulk Create Catalog Categories + # Create a catalog category bulk create job to create a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_create_job_create_query [CatalogCategoryCreateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_catalog_category_relationships_items_with_http_info(id, catalog_category_item_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_create_catalog_categories_with_http_info(catalog_category_create_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_category_relationships_items ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.create_catalog_category_relationships_items" + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_create_catalog_categories ...' end - # verify the required parameter 'catalog_category_item_op' is set - if @api_client.config.client_side_validation && catalog_category_item_op.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.create_catalog_category_relationships_items" + # verify the required parameter 'catalog_category_create_job_create_query' is set + if @api_client.config.client_side_validation && catalog_category_create_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_create_job_create_query' when calling CatalogsApi.bulk_create_catalog_categories" end # resource path - local_var_path = '/api/catalog-categories/{id}/relationships/items/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-category-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} @@ -200,11 +233,11 @@ def create_catalog_category_relationships_items_with_http_info(id, catalog_categ # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -213,16 +246,16 @@ def create_catalog_category_relationships_items_with_http_info(id, catalog_categ form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_create_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.create_catalog_category_relationships_items", + :operation => :"CatalogsApi.bulk_create_catalog_categories", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -233,39 +266,48 @@ def create_catalog_category_relationships_items_with_http_info(id, catalog_categ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_category_relationships_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_create_catalog_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `create_catalog_category_relationships_items_with_http_info` - alias create_catalog_category_relationships_item_with_http_info create_catalog_category_relationships_items_with_http_info + # alias of `bulk_create_catalog_categories_with_http_info` + alias spawn_create_categories_job_with_http_info bulk_create_catalog_categories_with_http_info - # Create Catalog Item - # Create a new catalog item.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_create_query [CatalogItemCreateQuery] + # alias of `bulk_create_catalog_categories_with_http_info` + alias create_catalog_category_bulk_create_job_with_http_info bulk_create_catalog_categories_with_http_info + + # Bulk Create Catalog Items + # Create a catalog item bulk create job to create a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_create_job_create_query [CatalogItemCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] - def create_catalog_item(catalog_item_create_query, opts = {}) - data, _status_code, _headers = create_catalog_item_with_http_info(catalog_item_create_query, opts) + def bulk_create_catalog_items(catalog_item_create_job_create_query, opts = {}) + data, _status_code, _headers = bulk_create_catalog_items_with_http_info(catalog_item_create_job_create_query, opts) data end - # Create Catalog Item - # Create a new catalog item.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_create_query [CatalogItemCreateQuery] + # alias of `bulk_create_catalog_items` + alias spawn_create_items_job bulk_create_catalog_items + + # alias of `bulk_create_catalog_items` + alias create_catalog_item_bulk_create_job bulk_create_catalog_items + + # Bulk Create Catalog Items + # Create a catalog item bulk create job to create a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_create_job_create_query [CatalogItemCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) + def bulk_create_catalog_items_with_http_info(catalog_item_create_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_item ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_create_catalog_items ...' end - # verify the required parameter 'catalog_item_create_query' is set - if @api_client.config.client_side_validation && catalog_item_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_create_query' when calling CatalogsApi.create_catalog_item" + # verify the required parameter 'catalog_item_create_job_create_query' is set + if @api_client.config.client_side_validation && catalog_item_create_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_create_job_create_query' when calling CatalogsApi.bulk_create_catalog_items" end # resource path - local_var_path = '/api/catalog-items/' + local_var_path = '/api/catalog-item-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} @@ -273,11 +315,11 @@ def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -286,7 +328,7 @@ def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -295,7 +337,7 @@ def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.create_catalog_item", + :operation => :"CatalogsApi.bulk_create_catalog_items", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -306,45 +348,48 @@ def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_create_catalog_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Catalog Item Relationships Categories - # Create a new catalog category relationship for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_item_category_op [CatalogItemCategoryOp] + # alias of `bulk_create_catalog_items_with_http_info` + alias spawn_create_items_job_with_http_info bulk_create_catalog_items_with_http_info + + # alias of `bulk_create_catalog_items_with_http_info` + alias create_catalog_item_bulk_create_job_with_http_info bulk_create_catalog_items_with_http_info + + # Bulk Create Catalog Variants + # Create a catalog variant bulk create job to create a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_create_job_create_query [CatalogVariantCreateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def create_catalog_item_relationships_categories(id, catalog_item_category_op, opts = {}) - create_catalog_item_relationships_categories_with_http_info(id, catalog_item_category_op, opts) - nil + # @return [Hash] + def bulk_create_catalog_variants(catalog_variant_create_job_create_query, opts = {}) + data, _status_code, _headers = bulk_create_catalog_variants_with_http_info(catalog_variant_create_job_create_query, opts) + data end - # alias of `create_catalog_item_relationships_categories` - alias create_catalog_item_relationships_category create_catalog_item_relationships_categories + # alias of `bulk_create_catalog_variants` + alias spawn_create_variants_job bulk_create_catalog_variants - # Create Catalog Item Relationships Categories - # Create a new catalog category relationship for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_item_category_op [CatalogItemCategoryOp] + # alias of `bulk_create_catalog_variants` + alias create_catalog_variant_bulk_create_job bulk_create_catalog_variants + + # Bulk Create Catalog Variants + # Create a catalog variant bulk create job to create a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_create_job_create_query [CatalogVariantCreateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_catalog_item_relationships_categories_with_http_info(id, catalog_item_category_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_create_catalog_variants_with_http_info(catalog_variant_create_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_item_relationships_categories ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.create_catalog_item_relationships_categories" + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_create_catalog_variants ...' end - # verify the required parameter 'catalog_item_category_op' is set - if @api_client.config.client_side_validation && catalog_item_category_op.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.create_catalog_item_relationships_categories" + # verify the required parameter 'catalog_variant_create_job_create_query' is set + if @api_client.config.client_side_validation && catalog_variant_create_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_variant_create_job_create_query' when calling CatalogsApi.bulk_create_catalog_variants" end # resource path - local_var_path = '/api/catalog-items/{id}/relationships/categories/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-variant-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} @@ -352,11 +397,11 @@ def create_catalog_item_relationships_categories_with_http_info(id, catalog_item # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -365,16 +410,16 @@ def create_catalog_item_relationships_categories_with_http_info(id, catalog_item form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_create_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.create_catalog_item_relationships_categories", + :operation => :"CatalogsApi.bulk_create_catalog_variants", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -385,39 +430,48 @@ def create_catalog_item_relationships_categories_with_http_info(id, catalog_item data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_item_relationships_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_create_catalog_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `create_catalog_item_relationships_categories_with_http_info` - alias create_catalog_item_relationships_category_with_http_info create_catalog_item_relationships_categories_with_http_info + # alias of `bulk_create_catalog_variants_with_http_info` + alias spawn_create_variants_job_with_http_info bulk_create_catalog_variants_with_http_info - # Create Catalog Variant - # Create a new variant for a related catalog item.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_create_query [CatalogVariantCreateQuery] + # alias of `bulk_create_catalog_variants_with_http_info` + alias create_catalog_variant_bulk_create_job_with_http_info bulk_create_catalog_variants_with_http_info + + # Bulk Delete Catalog Categories + # Create a catalog category bulk delete job to delete a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_delete_job_create_query [CatalogCategoryDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] - def create_catalog_variant(catalog_variant_create_query, opts = {}) - data, _status_code, _headers = create_catalog_variant_with_http_info(catalog_variant_create_query, opts) + def bulk_delete_catalog_categories(catalog_category_delete_job_create_query, opts = {}) + data, _status_code, _headers = bulk_delete_catalog_categories_with_http_info(catalog_category_delete_job_create_query, opts) data end - # Create Catalog Variant - # Create a new variant for a related catalog item.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_create_query [CatalogVariantCreateQuery] + # alias of `bulk_delete_catalog_categories` + alias spawn_delete_categories_job bulk_delete_catalog_categories + + # alias of `bulk_delete_catalog_categories` + alias create_catalog_category_bulk_delete_job bulk_delete_catalog_categories + + # Bulk Delete Catalog Categories + # Create a catalog category bulk delete job to delete a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_delete_job_create_query [CatalogCategoryDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = {}) + def bulk_delete_catalog_categories_with_http_info(catalog_category_delete_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_variant ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_delete_catalog_categories ...' end - # verify the required parameter 'catalog_variant_create_query' is set - if @api_client.config.client_side_validation && catalog_variant_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_variant_create_query' when calling CatalogsApi.create_catalog_variant" + # verify the required parameter 'catalog_category_delete_job_create_query' is set + if @api_client.config.client_side_validation && catalog_category_delete_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_delete_job_create_query' when calling CatalogsApi.bulk_delete_catalog_categories" end # resource path - local_var_path = '/api/catalog-variants/' + local_var_path = '/api/catalog-category-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} @@ -425,11 +479,11 @@ def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = { # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -438,7 +492,7 @@ def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = { form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_delete_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -447,7 +501,7 @@ def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = { auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.create_catalog_variant", + :operation => :"CatalogsApi.bulk_delete_catalog_categories", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -458,36 +512,48 @@ def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = { data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_delete_catalog_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Catalog Category - # Delete a catalog category using the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `bulk_delete_catalog_categories_with_http_info` + alias spawn_delete_categories_job_with_http_info bulk_delete_catalog_categories_with_http_info + + # alias of `bulk_delete_catalog_categories_with_http_info` + alias create_catalog_category_bulk_delete_job_with_http_info bulk_delete_catalog_categories_with_http_info + + # Bulk Delete Catalog Items + # Create a catalog item bulk delete job to delete a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_delete_job_create_query [CatalogItemDeleteJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def delete_catalog_category(id, opts = {}) - delete_catalog_category_with_http_info(id, opts) - nil + # @return [Hash] + def bulk_delete_catalog_items(catalog_item_delete_job_create_query, opts = {}) + data, _status_code, _headers = bulk_delete_catalog_items_with_http_info(catalog_item_delete_job_create_query, opts) + data end - # Delete Catalog Category - # Delete a catalog category using the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `bulk_delete_catalog_items` + alias spawn_delete_items_job bulk_delete_catalog_items + + # alias of `bulk_delete_catalog_items` + alias create_catalog_item_bulk_delete_job bulk_delete_catalog_items + + # Bulk Delete Catalog Items + # Create a catalog item bulk delete job to delete a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_delete_job_create_query [CatalogItemDeleteJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_catalog_category_with_http_info(id, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_delete_catalog_items_with_http_info(catalog_item_delete_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_category ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_delete_catalog_items ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_category" + # verify the required parameter 'catalog_item_delete_job_create_query' is set + if @api_client.config.client_side_validation && catalog_item_delete_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_delete_job_create_query' when calling CatalogsApi.bulk_delete_catalog_items" end # resource path - local_var_path = '/api/catalog-categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-item-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} @@ -495,24 +561,29 @@ def delete_catalog_category_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_delete_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.delete_catalog_category", + :operation => :"CatalogsApi.bulk_delete_catalog_items", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -521,44 +592,50 @@ def delete_catalog_category_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_delete_catalog_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Catalog Category Relationships Items - # Delete item relationships for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_category_item_op [CatalogCategoryItemOp] + # alias of `bulk_delete_catalog_items_with_http_info` + alias spawn_delete_items_job_with_http_info bulk_delete_catalog_items_with_http_info + + # alias of `bulk_delete_catalog_items_with_http_info` + alias create_catalog_item_bulk_delete_job_with_http_info bulk_delete_catalog_items_with_http_info + + # Bulk Delete Catalog Variants + # Create a catalog variant bulk delete job to delete a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_delete_job_create_query [CatalogVariantDeleteJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def delete_catalog_category_relationships_items(id, catalog_category_item_op, opts = {}) - delete_catalog_category_relationships_items_with_http_info(id, catalog_category_item_op, opts) - nil + # @return [Hash] + def bulk_delete_catalog_variants(catalog_variant_delete_job_create_query, opts = {}) + data, _status_code, _headers = bulk_delete_catalog_variants_with_http_info(catalog_variant_delete_job_create_query, opts) + data end - # Delete Catalog Category Relationships Items - # Delete item relationships for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_category_item_op [CatalogCategoryItemOp] + # alias of `bulk_delete_catalog_variants` + alias spawn_delete_variants_job bulk_delete_catalog_variants + + # alias of `bulk_delete_catalog_variants` + alias create_catalog_variant_bulk_delete_job bulk_delete_catalog_variants + + # Bulk Delete Catalog Variants + # Create a catalog variant bulk delete job to delete a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_delete_job_create_query [CatalogVariantDeleteJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_catalog_category_relationships_items_with_http_info(id, catalog_category_item_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_delete_catalog_variants_with_http_info(catalog_variant_delete_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_category_relationships_items ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_category_relationships_items" + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_delete_catalog_variants ...' end - # verify the required parameter 'catalog_category_item_op' is set - if @api_client.config.client_side_validation && catalog_category_item_op.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.delete_catalog_category_relationships_items" + # verify the required parameter 'catalog_variant_delete_job_create_query' is set + if @api_client.config.client_side_validation && catalog_variant_delete_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_variant_delete_job_create_query' when calling CatalogsApi.bulk_delete_catalog_variants" end # resource path - local_var_path = '/api/catalog-categories/{id}/relationships/items/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-variant-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} @@ -566,11 +643,11 @@ def delete_catalog_category_relationships_items_with_http_info(id, catalog_categ # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -579,16 +656,16 @@ def delete_catalog_category_relationships_items_with_http_info(id, catalog_categ form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_delete_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.delete_catalog_category_relationships_items", + :operation => :"CatalogsApi.bulk_delete_catalog_variants", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -597,38 +674,50 @@ def delete_catalog_category_relationships_items_with_http_info(id, catalog_categ :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_category_relationships_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_delete_catalog_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Catalog Item - # Delete a catalog item with the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_catalog_item(id, opts = {}) - delete_catalog_item_with_http_info(id, opts) - nil + # alias of `bulk_delete_catalog_variants_with_http_info` + alias spawn_delete_variants_job_with_http_info bulk_delete_catalog_variants_with_http_info + + # alias of `bulk_delete_catalog_variants_with_http_info` + alias create_catalog_variant_bulk_delete_job_with_http_info bulk_delete_catalog_variants_with_http_info + + # Bulk Update Catalog Categories + # Create a catalog category bulk update job to update a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_update_job_create_query [CatalogCategoryUpdateJobCreateQuery] + # @param [Hash] opts the optional parameters + # @return [Hash] + def bulk_update_catalog_categories(catalog_category_update_job_create_query, opts = {}) + data, _status_code, _headers = bulk_update_catalog_categories_with_http_info(catalog_category_update_job_create_query, opts) + data end - # Delete Catalog Item - # Delete a catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `bulk_update_catalog_categories` + alias spawn_update_categories_job bulk_update_catalog_categories + + # alias of `bulk_update_catalog_categories` + alias create_catalog_category_bulk_update_job bulk_update_catalog_categories + + # Bulk Update Catalog Categories + # Create a catalog category bulk update job to update a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_update_job_create_query [CatalogCategoryUpdateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_catalog_item_with_http_info(id, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_update_catalog_categories_with_http_info(catalog_category_update_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_item ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_update_catalog_categories ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_item" + # verify the required parameter 'catalog_category_update_job_create_query' is set + if @api_client.config.client_side_validation && catalog_category_update_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_update_job_create_query' when calling CatalogsApi.bulk_update_catalog_categories" end # resource path - local_var_path = '/api/catalog-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-category-bulk-update-jobs' # query parameters query_params = opts[:query_params] || {} @@ -636,24 +725,29 @@ def delete_catalog_item_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_update_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.delete_catalog_item", + :operation => :"CatalogsApi.bulk_update_catalog_categories", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -662,44 +756,50 @@ def delete_catalog_item_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_update_catalog_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Catalog Item Relationships Categories - # Delete catalog category relationships for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_item_category_op [CatalogItemCategoryOp] + # alias of `bulk_update_catalog_categories_with_http_info` + alias spawn_update_categories_job_with_http_info bulk_update_catalog_categories_with_http_info + + # alias of `bulk_update_catalog_categories_with_http_info` + alias create_catalog_category_bulk_update_job_with_http_info bulk_update_catalog_categories_with_http_info + + # Bulk Update Catalog Items + # Create a catalog item bulk update job to update a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_update_job_create_query [CatalogItemUpdateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def delete_catalog_item_relationships_categories(id, catalog_item_category_op, opts = {}) - delete_catalog_item_relationships_categories_with_http_info(id, catalog_item_category_op, opts) - nil + # @return [Hash] + def bulk_update_catalog_items(catalog_item_update_job_create_query, opts = {}) + data, _status_code, _headers = bulk_update_catalog_items_with_http_info(catalog_item_update_job_create_query, opts) + data end - # Delete Catalog Item Relationships Categories - # Delete catalog category relationships for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_item_category_op [CatalogItemCategoryOp] + # alias of `bulk_update_catalog_items` + alias spawn_update_items_job bulk_update_catalog_items + + # alias of `bulk_update_catalog_items` + alias create_catalog_item_bulk_update_job bulk_update_catalog_items + + # Bulk Update Catalog Items + # Create a catalog item bulk update job to update a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_update_job_create_query [CatalogItemUpdateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_catalog_item_relationships_categories_with_http_info(id, catalog_item_category_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_update_catalog_items_with_http_info(catalog_item_update_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_item_relationships_categories ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_item_relationships_categories" + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_update_catalog_items ...' end - # verify the required parameter 'catalog_item_category_op' is set - if @api_client.config.client_side_validation && catalog_item_category_op.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.delete_catalog_item_relationships_categories" + # verify the required parameter 'catalog_item_update_job_create_query' is set + if @api_client.config.client_side_validation && catalog_item_update_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_update_job_create_query' when calling CatalogsApi.bulk_update_catalog_items" end # resource path - local_var_path = '/api/catalog-items/{id}/relationships/categories/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-item-bulk-update-jobs' # query parameters query_params = opts[:query_params] || {} @@ -707,11 +807,11 @@ def delete_catalog_item_relationships_categories_with_http_info(id, catalog_item # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -720,16 +820,16 @@ def delete_catalog_item_relationships_categories_with_http_info(id, catalog_item form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_update_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.delete_catalog_item_relationships_categories", + :operation => :"CatalogsApi.bulk_update_catalog_items", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -738,38 +838,50 @@ def delete_catalog_item_relationships_categories_with_http_info(id, catalog_item :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_item_relationships_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_update_catalog_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Catalog Variant - # Delete a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `bulk_update_catalog_items_with_http_info` + alias spawn_update_items_job_with_http_info bulk_update_catalog_items_with_http_info + + # alias of `bulk_update_catalog_items_with_http_info` + alias create_catalog_item_bulk_update_job_with_http_info bulk_update_catalog_items_with_http_info + + # Bulk Update Catalog Variants + # Create a catalog variant bulk update job to update a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_update_job_create_query [CatalogVariantUpdateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def delete_catalog_variant(id, opts = {}) - delete_catalog_variant_with_http_info(id, opts) - nil + # @return [Hash] + def bulk_update_catalog_variants(catalog_variant_update_job_create_query, opts = {}) + data, _status_code, _headers = bulk_update_catalog_variants_with_http_info(catalog_variant_update_job_create_query, opts) + data end - # Delete Catalog Variant - # Delete a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `bulk_update_catalog_variants` + alias spawn_update_variants_job bulk_update_catalog_variants + + # alias of `bulk_update_catalog_variants` + alias create_catalog_variant_bulk_update_job bulk_update_catalog_variants + + # Bulk Update Catalog Variants + # Create a catalog variant bulk update job to update a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_update_job_create_query [CatalogVariantUpdateJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_catalog_variant_with_http_info(id, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_update_catalog_variants_with_http_info(catalog_variant_update_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_variant ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.bulk_update_catalog_variants ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_variant" + # verify the required parameter 'catalog_variant_update_job_create_query' is set + if @api_client.config.client_side_validation && catalog_variant_update_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_variant_update_job_create_query' when calling CatalogsApi.bulk_update_catalog_variants" end # resource path - local_var_path = '/api/catalog-variants/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-variant-bulk-update-jobs' # query parameters query_params = opts[:query_params] || {} @@ -777,24 +889,29 @@ def delete_catalog_variant_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_update_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.delete_catalog_variant", + :operation => :"CatalogsApi.bulk_update_catalog_variants", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -803,77 +920,74 @@ def delete_catalog_variant_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#bulk_update_catalog_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Categories - # Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 categories per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `bulk_update_catalog_variants_with_http_info` + alias spawn_update_variants_job_with_http_info bulk_update_catalog_variants_with_http_info + + # alias of `bulk_update_catalog_variants_with_http_info` + alias create_catalog_variant_bulk_update_job_with_http_info bulk_update_catalog_variants_with_http_info + + # Create Back In Stock Subscription + # Subscribe a profile to receive back in stock notifications. Check out [our Back in Stock API guide](https://developers.klaviyo.com/en/docs/how_to_set_up_custom_back_in_stock) for more details. This endpoint is specifically designed to be called from server-side applications. To create subscriptions from client-side contexts, use [POST /client/back-in-stock-subscriptions](https://developers.klaviyo.com/en/reference/create_client_back_in_stock_subscription).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:write` `profiles:write` + # @param server_bis_subscription_create_query [ServerBISSubscriptionCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Hash] - def get_catalog_categories(opts = {}) - data, _status_code, _headers = get_catalog_categories_with_http_info(opts) - data + # @return [nil] + def create_back_in_stock_subscription(server_bis_subscription_create_query, opts = {}) + create_back_in_stock_subscription_with_http_info(server_bis_subscription_create_query, opts) + nil end - # Get Catalog Categories - # Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 categories per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Create Back In Stock Subscription + # Subscribe a profile to receive back in stock notifications. Check out [our Back in Stock API guide](https://developers.klaviyo.com/en/docs/how_to_set_up_custom_back_in_stock) for more details. This endpoint is specifically designed to be called from server-side applications. To create subscriptions from client-side contexts, use [POST /client/back-in-stock-subscriptions](https://developers.klaviyo.com/en/reference/create_client_back_in_stock_subscription).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:write` `profiles:write` + # @param server_bis_subscription_create_query [ServerBISSubscriptionCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_categories_with_http_info(opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_back_in_stock_subscription_with_http_info(server_bis_subscription_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_categories ...' - end - allowable_values = ["external_id", "name", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CatalogsApi.create_back_in_stock_subscription ...' end - allowable_values = ["created", "-created"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'server_bis_subscription_create_query' is set + if @api_client.config.client_side_validation && server_bis_subscription_create_query.nil? + fail ArgumentError, "Missing the required parameter 'server_bis_subscription_create_query' when calling CatalogsApi.create_back_in_stock_subscription" end # resource path - local_var_path = '/api/catalog-categories/' + local_var_path = '/api/back-in-stock-subscriptions' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(server_bis_subscription_create_query) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_categories", + :operation => :"CatalogsApi.create_back_in_stock_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -882,61 +996,59 @@ def get_catalog_categories_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#create_back_in_stock_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Category - # Get a catalog category with the given category ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # Create Catalog Category + # Create a new catalog category.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_create_query [CatalogCategoryCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_catalog_category(id, opts = {}) - data, _status_code, _headers = get_catalog_category_with_http_info(id, opts) + def create_catalog_category(catalog_category_create_query, opts = {}) + data, _status_code, _headers = create_catalog_category_with_http_info(catalog_category_create_query, opts) data end - # Get Catalog Category - # Get a catalog category with the given category ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # Create Catalog Category + # Create a new catalog category.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_category_create_query [CatalogCategoryCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_category_with_http_info(id, opts = {}) + def create_catalog_category_with_http_info(catalog_category_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_category ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_category" + @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_category ...' end - allowable_values = ["external_id", "name", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" + # verify the required parameter 'catalog_category_create_query' is set + if @api_client.config.client_side_validation && catalog_category_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_create_query' when calling CatalogsApi.create_catalog_category" end # resource path - local_var_path = '/api/catalog-categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-categories' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -945,7 +1057,7 @@ def get_catalog_category_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_category", + :operation => :"CatalogsApi.create_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -954,88 +1066,59 @@ def get_catalog_category_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Category Items - # Get all items in a category with the given category ID. Items can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 items per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Create Catalog Item + # Create a new catalog item.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_create_query [CatalogItemCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Hash] - def get_catalog_category_items(id, opts = {}) - data, _status_code, _headers = get_catalog_category_items_with_http_info(id, opts) + def create_catalog_item(catalog_item_create_query, opts = {}) + data, _status_code, _headers = create_catalog_item_with_http_info(catalog_item_create_query, opts) data end - # Get Catalog Category Items - # Get all items in a category with the given category ID. Items can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 items per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Create Catalog Item + # Create a new catalog item.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_item_create_query [CatalogItemCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_category_items_with_http_info(id, opts = {}) + def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_category_items ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_category_items" - end - allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" - end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" - end - allowable_values = ["variants"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_item ...' end - allowable_values = ["created", "-created"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'catalog_item_create_query' is set + if @api_client.config.client_side_validation && catalog_item_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_create_query' when calling CatalogsApi.create_catalog_item" end # resource path - local_var_path = '/api/catalog-categories/{id}/items/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-items' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -1044,7 +1127,7 @@ def get_catalog_category_items_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_category_items", + :operation => :"CatalogsApi.create_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1053,57 +1136,59 @@ def get_catalog_category_items_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Category Relationships Items - # Get all items in the given category ID. Returns a maximum of 100 items per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Create Catalog Variant + # Create a new variant for a related catalog item.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_create_query [CatalogVariantCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination # @return [Hash] - def get_catalog_category_relationships_items(id, opts = {}) - data, _status_code, _headers = get_catalog_category_relationships_items_with_http_info(id, opts) + def create_catalog_variant(catalog_variant_create_query, opts = {}) + data, _status_code, _headers = create_catalog_variant_with_http_info(catalog_variant_create_query, opts) data end - # Get Catalog Category Relationships Items - # Get all items in the given category ID. Returns a maximum of 100 items per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Create Catalog Variant + # Create a new variant for a related catalog item.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param catalog_variant_create_query [CatalogVariantCreateQuery] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_category_relationships_items_with_http_info(id, opts = {}) + def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_category_relationships_items ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_variant ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_category_relationships_items" + # verify the required parameter 'catalog_variant_create_query' is set + if @api_client.config.client_side_validation && catalog_variant_create_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_variant_create_query' when calling CatalogsApi.create_catalog_variant" end # resource path - local_var_path = '/api/catalog-categories/{id}/relationships/items/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-variants' # query parameters query_params = opts[:query_params] || {} - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -1112,7 +1197,7 @@ def get_catalog_category_relationships_items_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_category_relationships_items", + :operation => :"CatalogsApi.create_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1121,69 +1206,48 @@ def get_catalog_category_relationships_items_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category_relationships_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Item - # Get a specific catalog item with the given item ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # Delete Catalog Category + # Delete a catalog category using the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @return [Hash] - def get_catalog_item(id, opts = {}) - data, _status_code, _headers = get_catalog_item_with_http_info(id, opts) - data + # @return [nil] + def delete_catalog_category(id, opts = {}) + delete_catalog_category_with_http_info(id, opts) + nil end - # Get Catalog Item - # Get a specific catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # Delete Catalog Category + # Delete a catalog category using the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_item_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_catalog_category_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_item" - end - allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" - end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" - end - allowable_values = ["variants"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_category ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_category" end # resource path - local_var_path = '/api/catalog-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-categories/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1192,13 +1256,13 @@ def get_catalog_item_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_item", + :operation => :"CatalogsApi.delete_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1207,68 +1271,48 @@ def get_catalog_item_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Item Categories - # Get all catalog categories that an item with the given item ID is in. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 categories per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Delete Catalog Item + # Delete a catalog item with the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Hash] - def get_catalog_item_categories(id, opts = {}) - data, _status_code, _headers = get_catalog_item_categories_with_http_info(id, opts) - data + # @return [nil] + def delete_catalog_item(id, opts = {}) + delete_catalog_item_with_http_info(id, opts) + nil end - # Get Catalog Item Categories - # Get all catalog categories that an item with the given item ID is in. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 categories per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Delete Catalog Item + # Delete a catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_item_categories_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item_categories ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_item ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_item_categories" - end - allowable_values = ["external_id", "name", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" - end - allowable_values = ["created", "-created"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_item" end # resource path - local_var_path = '/api/catalog-items/{id}/categories/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-items/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1277,13 +1321,13 @@ def get_catalog_item_categories_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_item_categories", + :operation => :"CatalogsApi.delete_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1292,51 +1336,48 @@ def get_catalog_item_categories_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Item Relationships Categories - # Get all catalog categories that a particular item is in. Returns a maximum of 100 categories per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Delete Catalog Variant + # Delete a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @return [Hash] - def get_catalog_item_relationships_categories(id, opts = {}) - data, _status_code, _headers = get_catalog_item_relationships_categories_with_http_info(id, opts) - data + # @return [nil] + def delete_catalog_variant(id, opts = {}) + delete_catalog_variant_with_http_info(id, opts) + nil end - # Get Catalog Item Relationships Categories - # Get all catalog categories that a particular item is in. Returns a maximum of 100 categories per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Delete Catalog Variant + # Delete a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_item_relationships_categories_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_catalog_variant_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item_relationships_categories ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_variant ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_item_relationships_categories" + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.delete_catalog_variant" end # resource path - local_var_path = '/api/catalog-items/{id}/relationships/categories/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-variants/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1345,13 +1386,13 @@ def get_catalog_item_relationships_categories_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_item_relationships_categories", + :operation => :"CatalogsApi.delete_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1360,68 +1401,75 @@ def get_catalog_item_relationships_categories_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item_relationships_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Item Variants - # Get all variants related to the given item ID. Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # Get Bulk Create Catalog Items Job + # Get a catalog item bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_catalog_item_variants(id, opts = {}) - data, _status_code, _headers = get_catalog_item_variants_with_http_info(id, opts) + def get_bulk_create_catalog_items_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_create_catalog_items_job_with_http_info(job_id, opts) data end - # Get Catalog Item Variants - # Get all variants related to the given item ID. Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] + # alias of `get_bulk_create_catalog_items_job` + alias get_create_items_job get_bulk_create_catalog_items_job + + # alias of `get_bulk_create_catalog_items_job` + alias get_catalog_item_bulk_create_job get_bulk_create_catalog_items_job + + # Get Bulk Create Catalog Items Job + # Get a catalog item bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_item_variants_with_http_info(id, opts = {}) + def get_bulk_create_catalog_items_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item_variants ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_bulk_create_catalog_items_job ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_item_variants" + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_bulk_create_catalog_items_job" end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_create_job'] && !opts[:'fields_catalog_item_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_create_job\", must include one of #{allowable_values}" end - allowable_values = ["created", "-created"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" + end + allowable_values = ["items"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-items/{id}/variants/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-item-bulk-create-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'fields[catalog-item-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_create_job'], :csv) if !opts[:'fields_catalog_item_bulk_create_job'].nil? + query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1436,7 +1484,7 @@ def get_catalog_item_variants_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_item_variants", + :operation => :"CatalogsApi.get_bulk_create_catalog_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1447,74 +1495,65 @@ def get_catalog_item_variants_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_bulk_create_catalog_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Items - # Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 items per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_create_catalog_items_job_with_http_info` + alias get_create_items_job_with_http_info get_bulk_create_catalog_items_job_with_http_info + + # alias of `get_bulk_create_catalog_items_job_with_http_info` + alias get_catalog_item_bulk_create_job_with_http_info get_bulk_create_catalog_items_job_with_http_info + + # Get Bulk Create Catalog Items Jobs + # Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_catalog_items(opts = {}) - data, _status_code, _headers = get_catalog_items_with_http_info(opts) + def get_bulk_create_catalog_items_jobs(opts = {}) + data, _status_code, _headers = get_bulk_create_catalog_items_jobs_with_http_info(opts) data end - # Get Catalog Items - # Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 items per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_create_catalog_items_jobs` + alias get_create_items_jobs get_bulk_create_catalog_items_jobs + + # alias of `get_bulk_create_catalog_items_jobs` + alias get_catalog_item_bulk_create_jobs get_bulk_create_catalog_items_jobs + + # Get Bulk Create Catalog Items Jobs + # Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_items_with_http_info(opts = {}) + def get_bulk_create_catalog_items_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_items ...' - end - allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" - end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" - end - allowable_values = ["variants"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_bulk_create_catalog_items_jobs ...' end - allowable_values = ["created", "-created"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_create_job'] && !opts[:'fields_catalog_item_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_create_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-items/' + local_var_path = '/api/catalog-item-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? + query_params[:'fields[catalog-item-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_create_job'], :csv) if !opts[:'fields_catalog_item_bulk_create_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1529,7 +1568,7 @@ def get_catalog_items_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_items", + :operation => :"CatalogsApi.get_bulk_create_catalog_items_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1540,53 +1579,65 @@ def get_catalog_items_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_bulk_create_catalog_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Variant - # Get a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `get_bulk_create_catalog_items_jobs_with_http_info` + alias get_create_items_jobs_with_http_info get_bulk_create_catalog_items_jobs_with_http_info + + # alias of `get_bulk_create_catalog_items_jobs_with_http_info` + alias get_catalog_item_bulk_create_jobs_with_http_info get_bulk_create_catalog_items_jobs_with_http_info + + # Get Bulk Delete Catalog Items Job + # Get a catalog item bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_catalog_variant(id, opts = {}) - data, _status_code, _headers = get_catalog_variant_with_http_info(id, opts) + def get_bulk_delete_catalog_items_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_delete_catalog_items_job_with_http_info(job_id, opts) data end - # Get Catalog Variant - # Get a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # alias of `get_bulk_delete_catalog_items_job` + alias get_delete_items_job get_bulk_delete_catalog_items_job + + # alias of `get_bulk_delete_catalog_items_job` + alias get_catalog_item_bulk_delete_job get_bulk_delete_catalog_items_job + + # Get Bulk Delete Catalog Items Job + # Get a catalog item bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_variant_with_http_info(id, opts = {}) + def get_bulk_delete_catalog_items_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_variant ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_bulk_delete_catalog_items_job ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_variant" + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_bulk_delete_catalog_items_job" end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_delete_job'] && !opts[:'fields_catalog_item_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_delete_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variants/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-item-bulk-delete-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? + query_params[:'fields[catalog-item-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_delete_job'], :csv) if !opts[:'fields_catalog_item_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1601,7 +1652,7 @@ def get_catalog_variant_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_variant", + :operation => :"CatalogsApi.get_bulk_delete_catalog_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1612,60 +1663,65 @@ def get_catalog_variant_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_bulk_delete_catalog_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Catalog Variants - # Get all variants in an account. Variants can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 variants per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_delete_catalog_items_job_with_http_info` + alias get_delete_items_job_with_http_info get_bulk_delete_catalog_items_job_with_http_info + + # alias of `get_bulk_delete_catalog_items_job_with_http_info` + alias get_catalog_item_bulk_delete_job_with_http_info get_bulk_delete_catalog_items_job_with_http_info + + # Get Bulk Delete Catalog Items Jobs + # Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_catalog_variants(opts = {}) - data, _status_code, _headers = get_catalog_variants_with_http_info(opts) + def get_bulk_delete_catalog_items_jobs(opts = {}) + data, _status_code, _headers = get_bulk_delete_catalog_items_jobs_with_http_info(opts) data end - # Get Catalog Variants - # Get all variants in an account. Variants can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 variants per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_delete_catalog_items_jobs` + alias get_delete_items_jobs get_bulk_delete_catalog_items_jobs + + # alias of `get_bulk_delete_catalog_items_jobs` + alias get_catalog_item_bulk_delete_jobs get_bulk_delete_catalog_items_jobs + + # Get Bulk Delete Catalog Items Jobs + # Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_catalog_variants_with_http_info(opts = {}) + def get_bulk_delete_catalog_items_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_variants ...' - end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_bulk_delete_catalog_items_jobs ...' end - allowable_values = ["created", "-created"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_delete_job'] && !opts[:'fields_catalog_item_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_delete_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variants/' + local_var_path = '/api/catalog-item-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? + query_params[:'fields[catalog-item-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_delete_job'], :csv) if !opts[:'fields_catalog_item_bulk_delete_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1680,7 +1736,7 @@ def get_catalog_variants_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_catalog_variants", + :operation => :"CatalogsApi.get_bulk_delete_catalog_items_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1691,70 +1747,79 @@ def get_catalog_variants_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_bulk_delete_catalog_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Create Categories Job - # Get a catalog category bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_delete_catalog_items_jobs_with_http_info` + alias get_delete_items_jobs_with_http_info get_bulk_delete_catalog_items_jobs_with_http_info + + # alias of `get_bulk_delete_catalog_items_jobs_with_http_info` + alias get_catalog_item_bulk_delete_jobs_with_http_info get_bulk_delete_catalog_items_jobs_with_http_info + + # Get Bulk Update Catalog Items Job + # Get a catalog item bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_create_categories_job(job_id, opts = {}) - data, _status_code, _headers = get_create_categories_job_with_http_info(job_id, opts) + def get_bulk_update_catalog_items_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_update_catalog_items_job_with_http_info(job_id, opts) data end - # alias of `get_create_categories_job` - alias get_catalog_category_bulk_create_job get_create_categories_job + # alias of `get_bulk_update_catalog_items_job` + alias get_update_items_job get_bulk_update_catalog_items_job - # Get Create Categories Job - # Get a catalog category bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_update_catalog_items_job` + alias get_catalog_item_bulk_update_job get_bulk_update_catalog_items_job + + # Get Bulk Update Catalog Items Job + # Get a catalog item bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_create_categories_job_with_http_info(job_id, opts = {}) + def get_bulk_update_catalog_items_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_categories_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_bulk_update_catalog_items_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_categories_job" + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_bulk_update_catalog_items_job" end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_create_job'] && !opts[:'fields_catalog_category_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_create_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_update_job'] && !opts[:'fields_catalog_item_bulk_update_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_update_job\", must include one of #{allowable_values}" end - allowable_values = ["external_id", "name", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end - allowable_values = ["categories"] + allowable_values = ["items"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-item-bulk-update-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_create_job'], :csv) if !opts[:'fields_catalog_category_bulk_create_job'].nil? - query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? + query_params[:'fields[catalog-item-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_update_job'], :csv) if !opts[:'fields_catalog_item_bulk_update_job'].nil? + query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1769,7 +1834,7 @@ def get_create_categories_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_create_categories_job", + :operation => :"CatalogsApi.get_bulk_update_catalog_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1780,59 +1845,65 @@ def get_create_categories_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_create_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_bulk_update_catalog_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_create_categories_job_with_http_info` - alias get_catalog_category_bulk_create_job_with_http_info get_create_categories_job_with_http_info + # alias of `get_bulk_update_catalog_items_job_with_http_info` + alias get_update_items_job_with_http_info get_bulk_update_catalog_items_job_with_http_info - # Get Create Categories Jobs - # Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_update_catalog_items_job_with_http_info` + alias get_catalog_item_bulk_update_job_with_http_info get_bulk_update_catalog_items_job_with_http_info + + # Get Bulk Update Catalog Items Jobs + # Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_create_categories_jobs(opts = {}) - data, _status_code, _headers = get_create_categories_jobs_with_http_info(opts) + def get_bulk_update_catalog_items_jobs(opts = {}) + data, _status_code, _headers = get_bulk_update_catalog_items_jobs_with_http_info(opts) data end - # alias of `get_create_categories_jobs` - alias get_catalog_category_bulk_create_jobs get_create_categories_jobs + # alias of `get_bulk_update_catalog_items_jobs` + alias get_update_items_jobs get_bulk_update_catalog_items_jobs - # Get Create Categories Jobs - # Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # alias of `get_bulk_update_catalog_items_jobs` + alias get_catalog_item_bulk_update_jobs get_bulk_update_catalog_items_jobs + + # Get Bulk Update Catalog Items Jobs + # Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_create_categories_jobs_with_http_info(opts = {}) + def get_bulk_update_catalog_items_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_categories_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_bulk_update_catalog_items_jobs ...' end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_create_job'] && !opts[:'fields_catalog_category_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_create_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_update_job'] && !opts[:'fields_catalog_item_bulk_update_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_update_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-create-jobs/' + local_var_path = '/api/catalog-item-bulk-update-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_create_job'], :csv) if !opts[:'fields_catalog_category_bulk_create_job'].nil? + query_params[:'fields[catalog-item-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_update_job'], :csv) if !opts[:'fields_catalog_item_bulk_update_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1847,7 +1918,7 @@ def get_create_categories_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_create_categories_jobs", + :operation => :"CatalogsApi.get_bulk_update_catalog_items_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1858,73 +1929,66 @@ def get_create_categories_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_create_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_bulk_update_catalog_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_create_categories_jobs_with_http_info` - alias get_catalog_category_bulk_create_jobs_with_http_info get_create_categories_jobs_with_http_info + # alias of `get_bulk_update_catalog_items_jobs_with_http_info` + alias get_update_items_jobs_with_http_info get_bulk_update_catalog_items_jobs_with_http_info - # Get Create Items Job - # Get a catalog item bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # alias of `get_bulk_update_catalog_items_jobs_with_http_info` + alias get_catalog_item_bulk_update_jobs_with_http_info get_bulk_update_catalog_items_jobs_with_http_info + + # Get Catalog Categories + # Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 categories per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_create_items_job(job_id, opts = {}) - data, _status_code, _headers = get_create_items_job_with_http_info(job_id, opts) + def get_catalog_categories(opts = {}) + data, _status_code, _headers = get_catalog_categories_with_http_info(opts) data end - # alias of `get_create_items_job` - alias get_catalog_item_bulk_create_job get_create_items_job - - # Get Create Items Job - # Get a catalog item bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Catalog Categories + # Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 categories per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_create_items_job_with_http_info(job_id, opts = {}) + def get_catalog_categories_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_items_job ...' - end - # verify the required parameter 'job_id' is set - if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_items_job" - end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_create_job'] && !opts[:'fields_catalog_item_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_create_job\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_categories ...' end - allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" + allowable_values = ["external_id", "name", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end - allowable_values = ["items"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-categories' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_create_job'], :csv) if !opts[:'fields_catalog_item_bulk_create_job'].nil? - query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1939,7 +2003,7 @@ def get_create_items_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_create_items_job", + :operation => :"CatalogsApi.get_catalog_categories", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1950,59 +2014,53 @@ def get_create_items_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_create_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_create_items_job_with_http_info` - alias get_catalog_item_bulk_create_job_with_http_info get_create_items_job_with_http_info - - # Get Create Items Jobs - # Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Catalog Category + # Get a catalog category with the given category ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_create_items_jobs(opts = {}) - data, _status_code, _headers = get_create_items_jobs_with_http_info(opts) + def get_catalog_category(id, opts = {}) + data, _status_code, _headers = get_catalog_category_with_http_info(id, opts) data end - # alias of `get_create_items_jobs` - alias get_catalog_item_bulk_create_jobs get_create_items_jobs - - # Get Create Items Jobs - # Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Catalog Category + # Get a catalog category with the given category ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_create_items_jobs_with_http_info(opts = {}) + def get_catalog_category_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_items_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_category ...' end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_create_job'] && !opts[:'fields_catalog_item_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_create_job\", must include one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_category" + end + allowable_values = ["external_id", "name", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-create-jobs/' + local_var_path = '/api/catalog-categories/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_create_job'], :csv) if !opts[:'fields_catalog_item_bulk_create_job'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2017,7 +2075,7 @@ def get_create_items_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_create_items_jobs", + :operation => :"CatalogsApi.get_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2028,49 +2086,43 @@ def get_create_items_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_create_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_create_items_jobs_with_http_info` - alias get_catalog_item_bulk_create_jobs_with_http_info get_create_items_jobs_with_http_info - - # Get Create Variants Job - # Get a catalog variant bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Catalog Item + # Get a specific catalog item with the given item ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_create_variants_job(job_id, opts = {}) - data, _status_code, _headers = get_create_variants_job_with_http_info(job_id, opts) + def get_catalog_item(id, opts = {}) + data, _status_code, _headers = get_catalog_item_with_http_info(id, opts) data end - # alias of `get_create_variants_job` - alias get_catalog_variant_bulk_create_job get_create_variants_job - - # Get Create Variants Job - # Get a catalog variant bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Catalog Item + # Get a specific catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_create_variants_job_with_http_info(job_id, opts = {}) + def get_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_variants_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item ...' end - # verify the required parameter 'job_id' is set - if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_variants_job" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_item" end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_create_job'] && !opts[:'fields_catalog_variant_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_create_job\", must include one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } @@ -2081,20 +2133,20 @@ def get_create_variants_job_with_http_info(job_id, opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-items/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_create_job'], :csv) if !opts[:'fields_catalog_variant_bulk_create_job'].nil? + query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2109,7 +2161,7 @@ def get_create_variants_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_create_variants_job", + :operation => :"CatalogsApi.get_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2120,59 +2172,74 @@ def get_create_variants_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_create_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_create_variants_job_with_http_info` - alias get_catalog_variant_bulk_create_job_with_http_info get_create_variants_job_with_http_info - - # Get Create Variants Jobs - # Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Catalog Items + # Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 items per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_create_variants_jobs(opts = {}) - data, _status_code, _headers = get_create_variants_jobs_with_http_info(opts) + def get_catalog_items(opts = {}) + data, _status_code, _headers = get_catalog_items_with_http_info(opts) data end - # alias of `get_create_variants_jobs` - alias get_catalog_variant_bulk_create_jobs get_create_variants_jobs - - # Get Create Variants Jobs - # Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Catalog Items + # Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 items per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_create_variants_jobs_with_http_info(opts = {}) + def get_catalog_items_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_variants_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_items ...' end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_create_job'] && !opts[:'fields_catalog_variant_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_create_job\", must include one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" + end + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + end + allowable_values = ["variants"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-create-jobs/' + local_var_path = '/api/catalog-items' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_create_job'], :csv) if !opts[:'fields_catalog_variant_bulk_create_job'].nil? + query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2187,7 +2254,7 @@ def get_create_variants_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_create_variants_jobs", + :operation => :"CatalogsApi.get_catalog_items", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2198,59 +2265,53 @@ def get_create_variants_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_create_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_create_variants_jobs_with_http_info` - alias get_catalog_variant_bulk_create_jobs_with_http_info get_create_variants_jobs_with_http_info - - # Get Delete Categories Job - # Get a catalog category bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Catalog Variant + # Get a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_delete_categories_job(job_id, opts = {}) - data, _status_code, _headers = get_delete_categories_job_with_http_info(job_id, opts) + def get_catalog_variant(id, opts = {}) + data, _status_code, _headers = get_catalog_variant_with_http_info(id, opts) data end - # alias of `get_delete_categories_job` - alias get_catalog_category_bulk_delete_job get_delete_categories_job - - # Get Delete Categories Job - # Get a catalog category bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Catalog Variant + # Get a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_delete_categories_job_with_http_info(job_id, opts = {}) + def get_catalog_variant_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_categories_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_variant ...' end - # verify the required parameter 'job_id' is set - if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_categories_job" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_catalog_variant" end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_delete_job'] && !opts[:'fields_catalog_category_bulk_delete_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_delete_job\", must include one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-delete-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-variants/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_delete_job'], :csv) if !opts[:'fields_catalog_category_bulk_delete_job'].nil? + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2265,7 +2326,7 @@ def get_delete_categories_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_delete_categories_job", + :operation => :"CatalogsApi.get_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2276,59 +2337,60 @@ def get_delete_categories_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_delete_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_delete_categories_job_with_http_info` - alias get_catalog_category_bulk_delete_job_with_http_info get_delete_categories_job_with_http_info - - # Get Delete Categories Jobs - # Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Catalog Variants + # Get all variants in an account. Variants can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 variants per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_delete_categories_jobs(opts = {}) - data, _status_code, _headers = get_delete_categories_jobs_with_http_info(opts) + def get_catalog_variants(opts = {}) + data, _status_code, _headers = get_catalog_variants_with_http_info(opts) data end - # alias of `get_delete_categories_jobs` - alias get_catalog_category_bulk_delete_jobs get_delete_categories_jobs - - # Get Delete Categories Jobs - # Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Catalog Variants + # Get all variants in an account. Variants can be sorted by the following fields, in ascending and descending order: `created` Currently, the only supported integration type is `$custom`, and the only supported catalog type is `$default`. Returns a maximum of 100 variants per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_delete_categories_jobs_with_http_info(opts = {}) + def get_catalog_variants_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_categories_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_variants ...' end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_delete_job'] && !opts[:'fields_catalog_category_bulk_delete_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_delete_job\", must include one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + end + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-delete-jobs/' + local_var_path = '/api/catalog-variants' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_delete_job'], :csv) if !opts[:'fields_catalog_category_bulk_delete_job'].nil? + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2343,7 +2405,7 @@ def get_delete_categories_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_delete_categories_jobs", + :operation => :"CatalogsApi.get_catalog_variants", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2354,59 +2416,65 @@ def get_delete_categories_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_delete_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_delete_categories_jobs_with_http_info` - alias get_catalog_category_bulk_delete_jobs_with_http_info get_delete_categories_jobs_with_http_info - - # Get Delete Items Job - # Get a catalog item bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Categories for Catalog Item + # Get all catalog categories that an item with the given item ID is in. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 categories per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_delete_items_job(job_id, opts = {}) - data, _status_code, _headers = get_delete_items_job_with_http_info(job_id, opts) + def get_categories_for_catalog_item(id, opts = {}) + data, _status_code, _headers = get_categories_for_catalog_item_with_http_info(id, opts) data end - # alias of `get_delete_items_job` - alias get_catalog_item_bulk_delete_job get_delete_items_job + # alias of `get_categories_for_catalog_item` + alias get_catalog_item_categories get_categories_for_catalog_item - # Get Delete Items Job - # Get a catalog item bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` - # @param job_id [String] ID of the job to retrieve. + # Get Categories for Catalog Item + # Get all catalog categories that an item with the given item ID is in. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 categories per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`name`: `contains` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_delete_items_job_with_http_info(job_id, opts = {}) + def get_categories_for_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_items_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_categories_for_catalog_item ...' end - # verify the required parameter 'job_id' is set - if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_items_job" + allowable_values = ["external_id", "name", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_delete_job'] && !opts[:'fields_catalog_item_bulk_delete_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_delete_job\", must include one of #{allowable_values}" + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-delete-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-items/{id}/categories'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_delete_job'], :csv) if !opts[:'fields_catalog_item_bulk_delete_job'].nil? + query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2421,7 +2489,7 @@ def get_delete_items_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_delete_items_job", + :operation => :"CatalogsApi.get_categories_for_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2432,59 +2500,55 @@ def get_delete_items_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_delete_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_categories_for_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_delete_items_job_with_http_info` - alias get_catalog_item_bulk_delete_job_with_http_info get_delete_items_job_with_http_info + # alias of `get_categories_for_catalog_item_with_http_info` + alias get_catalog_item_categories_with_http_info get_categories_for_catalog_item_with_http_info - # Get Delete Items Jobs - # Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Category IDs for Catalog Item + # Get all catalog categories that a particular item is in. Returns a maximum of 100 categories per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_delete_items_jobs(opts = {}) - data, _status_code, _headers = get_delete_items_jobs_with_http_info(opts) + def get_category_ids_for_catalog_item(id, opts = {}) + data, _status_code, _headers = get_category_ids_for_catalog_item_with_http_info(id, opts) data end - # alias of `get_delete_items_jobs` - alias get_catalog_item_bulk_delete_jobs get_delete_items_jobs + # alias of `get_category_ids_for_catalog_item` + alias get_catalog_item_relationships_categories get_category_ids_for_catalog_item - # Get Delete Items Jobs - # Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Category IDs for Catalog Item + # Get all catalog categories that a particular item is in. Returns a maximum of 100 categories per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_delete_items_jobs_with_http_info(opts = {}) + def get_category_ids_for_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_items_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_category_ids_for_catalog_item ...' end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_delete_job'] && !opts[:'fields_catalog_item_bulk_delete_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_delete_job\", must include one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_category_ids_for_catalog_item" end # resource path - local_var_path = '/api/catalog-item-bulk-delete-jobs/' + local_var_path = '/api/catalog-items/{id}/relationships/categories'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_delete_job'], :csv) if !opts[:'fields_catalog_item_bulk_delete_job'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2499,7 +2563,7 @@ def get_delete_items_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_delete_items_jobs", + :operation => :"CatalogsApi.get_category_ids_for_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2510,59 +2574,73 @@ def get_delete_items_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_delete_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_category_ids_for_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_delete_items_jobs_with_http_info` - alias get_catalog_item_bulk_delete_jobs_with_http_info get_delete_items_jobs_with_http_info + # alias of `get_category_ids_for_catalog_item_with_http_info` + alias get_catalog_item_relationships_categories_with_http_info get_category_ids_for_catalog_item_with_http_info - # Get Delete Variants Job - # Get a catalog variant bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Categories Job + # Get a catalog category bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_delete_variants_job(job_id, opts = {}) - data, _status_code, _headers = get_delete_variants_job_with_http_info(job_id, opts) + def get_create_categories_job(job_id, opts = {}) + data, _status_code, _headers = get_create_categories_job_with_http_info(job_id, opts) data end - # alias of `get_delete_variants_job` - alias get_catalog_variant_bulk_delete_job get_delete_variants_job + # alias of `get_create_categories_job` + alias get_catalog_category_bulk_create_job get_create_categories_job - # Get Delete Variants Job - # Get a catalog variant bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Categories Job + # Get a catalog category bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_delete_variants_job_with_http_info(job_id, opts = {}) + def get_create_categories_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_variants_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_categories_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_variants_job" + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_categories_job" end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_delete_job'] && !opts[:'fields_catalog_variant_bulk_delete_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_delete_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_create_job'] && !opts[:'fields_catalog_category_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_create_job\", must include one of #{allowable_values}" + end + allowable_values = ["external_id", "name", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" + end + allowable_values = ["categories"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-delete-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-category-bulk-create-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_delete_job'], :csv) if !opts[:'fields_catalog_variant_bulk_delete_job'].nil? + query_params[:'fields[catalog-category-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_create_job'], :csv) if !opts[:'fields_catalog_category_bulk_create_job'].nil? + query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2577,7 +2655,7 @@ def get_delete_variants_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_delete_variants_job", + :operation => :"CatalogsApi.get_create_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2588,59 +2666,59 @@ def get_delete_variants_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_delete_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_create_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_delete_variants_job_with_http_info` - alias get_catalog_variant_bulk_delete_job_with_http_info get_delete_variants_job_with_http_info + # alias of `get_create_categories_job_with_http_info` + alias get_catalog_category_bulk_create_job_with_http_info get_create_categories_job_with_http_info - # Get Delete Variants Jobs - # Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Categories Jobs + # Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_delete_variants_jobs(opts = {}) - data, _status_code, _headers = get_delete_variants_jobs_with_http_info(opts) + def get_create_categories_jobs(opts = {}) + data, _status_code, _headers = get_create_categories_jobs_with_http_info(opts) data end - # alias of `get_delete_variants_jobs` - alias get_catalog_variant_bulk_delete_jobs get_delete_variants_jobs + # alias of `get_create_categories_jobs` + alias get_catalog_category_bulk_create_jobs get_create_categories_jobs - # Get Delete Variants Jobs - # Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Categories Jobs + # Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_delete_variants_jobs_with_http_info(opts = {}) + def get_create_categories_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_variants_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_categories_jobs ...' end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_delete_job'] && !opts[:'fields_catalog_variant_bulk_delete_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_delete_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_create_job'] && !opts[:'fields_catalog_category_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_create_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-delete-jobs/' + local_var_path = '/api/catalog-category-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_delete_job'], :csv) if !opts[:'fields_catalog_variant_bulk_delete_job'].nil? + query_params[:'fields[catalog-category-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_create_job'], :csv) if !opts[:'fields_catalog_category_bulk_create_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2655,7 +2733,7 @@ def get_delete_variants_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_delete_variants_jobs", + :operation => :"CatalogsApi.get_create_categories_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2666,73 +2744,73 @@ def get_delete_variants_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_delete_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_create_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_delete_variants_jobs_with_http_info` - alias get_catalog_variant_bulk_delete_jobs_with_http_info get_delete_variants_jobs_with_http_info + # alias of `get_create_categories_jobs_with_http_info` + alias get_catalog_category_bulk_create_jobs_with_http_info get_create_categories_jobs_with_http_info - # Get Update Categories Job - # Get a catalog category bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Variants Job + # Get a catalog variant bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_update_categories_job(job_id, opts = {}) - data, _status_code, _headers = get_update_categories_job_with_http_info(job_id, opts) + def get_create_variants_job(job_id, opts = {}) + data, _status_code, _headers = get_create_variants_job_with_http_info(job_id, opts) data end - # alias of `get_update_categories_job` - alias get_catalog_category_bulk_update_job get_update_categories_job + # alias of `get_create_variants_job` + alias get_catalog_variant_bulk_create_job get_create_variants_job - # Get Update Categories Job - # Get a catalog category bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Variants Job + # Get a catalog variant bulk create job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_update_categories_job_with_http_info(job_id, opts = {}) + def get_create_variants_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_categories_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_variants_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_categories_job" + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_variants_job" end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_update_job'] && !opts[:'fields_catalog_category_bulk_update_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_update_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_create_job'] && !opts[:'fields_catalog_variant_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_create_job\", must include one of #{allowable_values}" end - allowable_values = ["external_id", "name", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end - allowable_values = ["categories"] + allowable_values = ["variants"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-update-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-variant-bulk-create-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_update_job'], :csv) if !opts[:'fields_catalog_category_bulk_update_job'].nil? - query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? + query_params[:'fields[catalog-variant-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_create_job'], :csv) if !opts[:'fields_catalog_variant_bulk_create_job'].nil? + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2747,7 +2825,7 @@ def get_update_categories_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_update_categories_job", + :operation => :"CatalogsApi.get_create_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2758,59 +2836,59 @@ def get_update_categories_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_update_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_create_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_update_categories_job_with_http_info` - alias get_catalog_category_bulk_update_job_with_http_info get_update_categories_job_with_http_info + # alias of `get_create_variants_job_with_http_info` + alias get_catalog_variant_bulk_create_job_with_http_info get_create_variants_job_with_http_info - # Get Update Categories Jobs - # Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Variants Jobs + # Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_update_categories_jobs(opts = {}) - data, _status_code, _headers = get_update_categories_jobs_with_http_info(opts) + def get_create_variants_jobs(opts = {}) + data, _status_code, _headers = get_create_variants_jobs_with_http_info(opts) data end - # alias of `get_update_categories_jobs` - alias get_catalog_category_bulk_update_jobs get_update_categories_jobs + # alias of `get_create_variants_jobs` + alias get_catalog_variant_bulk_create_jobs get_create_variants_jobs - # Get Update Categories Jobs - # Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Create Variants Jobs + # Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_update_categories_jobs_with_http_info(opts = {}) + def get_create_variants_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_categories_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_variants_jobs ...' end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_update_job'] && !opts[:'fields_catalog_category_bulk_update_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_update_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_create_job'] && !opts[:'fields_catalog_variant_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_create_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-update-jobs/' + local_var_path = '/api/catalog-variant-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-category-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_update_job'], :csv) if !opts[:'fields_catalog_category_bulk_update_job'].nil? + query_params[:'fields[catalog-variant-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_create_job'], :csv) if !opts[:'fields_catalog_variant_bulk_create_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2825,7 +2903,7 @@ def get_update_categories_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_update_categories_jobs", + :operation => :"CatalogsApi.get_create_variants_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2836,73 +2914,59 @@ def get_update_categories_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_update_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_create_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_update_categories_jobs_with_http_info` - alias get_catalog_category_bulk_update_jobs_with_http_info get_update_categories_jobs_with_http_info + # alias of `get_create_variants_jobs_with_http_info` + alias get_catalog_variant_bulk_create_jobs_with_http_info get_create_variants_jobs_with_http_info - # Get Update Items Job - # Get a catalog item bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Categories Job + # Get a catalog category bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_update_items_job(job_id, opts = {}) - data, _status_code, _headers = get_update_items_job_with_http_info(job_id, opts) + def get_delete_categories_job(job_id, opts = {}) + data, _status_code, _headers = get_delete_categories_job_with_http_info(job_id, opts) data end - # alias of `get_update_items_job` - alias get_catalog_item_bulk_update_job get_update_items_job + # alias of `get_delete_categories_job` + alias get_catalog_category_bulk_delete_job get_delete_categories_job - # Get Update Items Job - # Get a catalog item bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `items`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Categories Job + # Get a catalog category bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_update_items_job_with_http_info(job_id, opts = {}) + def get_delete_categories_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_items_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_categories_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_items_job" + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_categories_job" end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_update_job'] && !opts[:'fields_catalog_item_bulk_update_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_update_job\", must include one of #{allowable_values}" - end - allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" - end - allowable_values = ["items"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_delete_job'] && !opts[:'fields_catalog_category_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_delete_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-update-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-category-bulk-delete-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_update_job'], :csv) if !opts[:'fields_catalog_item_bulk_update_job'].nil? - query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'fields[catalog-category-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_delete_job'], :csv) if !opts[:'fields_catalog_category_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2917,7 +2981,7 @@ def get_update_items_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_update_items_job", + :operation => :"CatalogsApi.get_delete_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2928,59 +2992,59 @@ def get_update_items_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_update_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_delete_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_update_items_job_with_http_info` - alias get_catalog_item_bulk_update_job_with_http_info get_update_items_job_with_http_info + # alias of `get_delete_categories_job_with_http_info` + alias get_catalog_category_bulk_delete_job_with_http_info get_delete_categories_job_with_http_info - # Get Update Items Jobs - # Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Categories Jobs + # Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_update_items_jobs(opts = {}) - data, _status_code, _headers = get_update_items_jobs_with_http_info(opts) + def get_delete_categories_jobs(opts = {}) + data, _status_code, _headers = get_delete_categories_jobs_with_http_info(opts) data end - # alias of `get_update_items_jobs` - alias get_catalog_item_bulk_update_jobs get_update_items_jobs + # alias of `get_delete_categories_jobs` + alias get_catalog_category_bulk_delete_jobs get_delete_categories_jobs - # Get Update Items Jobs - # Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Categories Jobs + # Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_update_items_jobs_with_http_info(opts = {}) + def get_delete_categories_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_items_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_categories_jobs ...' end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_update_job'] && !opts[:'fields_catalog_item_bulk_update_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_update_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_delete_job'] && !opts[:'fields_catalog_category_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_delete_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-update-jobs/' + local_var_path = '/api/catalog-category-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-item-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_update_job'], :csv) if !opts[:'fields_catalog_item_bulk_update_job'].nil? + query_params[:'fields[catalog-category-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_delete_job'], :csv) if !opts[:'fields_catalog_category_bulk_delete_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -2995,7 +3059,7 @@ def get_update_items_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_update_items_jobs", + :operation => :"CatalogsApi.get_delete_categories_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3006,73 +3070,59 @@ def get_update_items_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_update_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_delete_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_update_items_jobs_with_http_info` - alias get_catalog_item_bulk_update_jobs_with_http_info get_update_items_jobs_with_http_info + # alias of `get_delete_categories_jobs_with_http_info` + alias get_catalog_category_bulk_delete_jobs_with_http_info get_delete_categories_jobs_with_http_info - # Get Update Variants Job - # Get a catalog variate bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Variants Job + # Get a catalog variant bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_update_variants_job(job_id, opts = {}) - data, _status_code, _headers = get_update_variants_job_with_http_info(job_id, opts) + def get_delete_variants_job(job_id, opts = {}) + data, _status_code, _headers = get_delete_variants_job_with_http_info(job_id, opts) data end - # alias of `get_update_variants_job` - alias get_catalog_variant_bulk_update_job get_update_variants_job + # alias of `get_delete_variants_job` + alias get_catalog_variant_bulk_delete_job get_delete_variants_job - # Get Update Variants Job - # Get a catalog variate bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Variants Job + # Get a catalog variant bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_update_variants_job_with_http_info(job_id, opts = {}) + def get_delete_variants_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_variants_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_variants_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_variants_job" + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_variants_job" end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_update_job'] && !opts[:'fields_catalog_variant_bulk_update_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_update_job\", must include one of #{allowable_values}" - end - allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" - end - allowable_values = ["variants"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_delete_job'] && !opts[:'fields_catalog_variant_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_delete_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-update-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/catalog-variant-bulk-delete-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_update_job'], :csv) if !opts[:'fields_catalog_variant_bulk_update_job'].nil? - query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'fields[catalog-variant-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_delete_job'], :csv) if !opts[:'fields_catalog_variant_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -3087,7 +3137,7 @@ def get_update_variants_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_update_variants_job", + :operation => :"CatalogsApi.get_delete_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3098,59 +3148,59 @@ def get_update_variants_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_update_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_delete_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_update_variants_job_with_http_info` - alias get_catalog_variant_bulk_update_job_with_http_info get_update_variants_job_with_http_info + # alias of `get_delete_variants_job_with_http_info` + alias get_catalog_variant_bulk_delete_job_with_http_info get_delete_variants_job_with_http_info - # Get Update Variants Jobs - # Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Variants Jobs + # Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_update_variants_jobs(opts = {}) - data, _status_code, _headers = get_update_variants_jobs_with_http_info(opts) + def get_delete_variants_jobs(opts = {}) + data, _status_code, _headers = get_delete_variants_jobs_with_http_info(opts) data end - # alias of `get_update_variants_jobs` - alias get_catalog_variant_bulk_update_jobs get_update_variants_jobs + # alias of `get_delete_variants_jobs` + alias get_catalog_variant_bulk_delete_jobs get_delete_variants_jobs - # Get Update Variants Jobs - # Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # Get Delete Variants Jobs + # Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_update_variants_jobs_with_http_info(opts = {}) + def get_delete_variants_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_variants_jobs ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_variants_jobs ...' end allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_update_job'] && !opts[:'fields_catalog_variant_bulk_update_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_update_job\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_delete_job'] && !opts[:'fields_catalog_variant_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_delete_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-update-jobs/' + local_var_path = '/api/catalog-variant-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[catalog-variant-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_update_job'], :csv) if !opts[:'fields_catalog_variant_bulk_update_job'].nil? + query_params[:'fields[catalog-variant-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_delete_job'], :csv) if !opts[:'fields_catalog_variant_bulk_delete_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -3165,7 +3215,7 @@ def get_update_variants_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.get_update_variants_jobs", + :operation => :"CatalogsApi.get_delete_variants_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3176,63 +3226,61 @@ def get_update_variants_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#get_update_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_delete_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_update_variants_jobs_with_http_info` - alias get_catalog_variant_bulk_update_jobs_with_http_info get_update_variants_jobs_with_http_info + # alias of `get_delete_variants_jobs_with_http_info` + alias get_catalog_variant_bulk_delete_jobs_with_http_info get_delete_variants_jobs_with_http_info - # Spawn Create Categories Job - # Create a catalog category bulk create job to create a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_create_job_create_query [CatalogCategoryCreateJobCreateQuery] + # Get Item IDs for Catalog Category + # Get all items in the given category ID. Returns a maximum of 100 items per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def spawn_create_categories_job(catalog_category_create_job_create_query, opts = {}) - data, _status_code, _headers = spawn_create_categories_job_with_http_info(catalog_category_create_job_create_query, opts) + def get_item_ids_for_catalog_category(id, opts = {}) + data, _status_code, _headers = get_item_ids_for_catalog_category_with_http_info(id, opts) data end - # alias of `spawn_create_categories_job` - alias create_catalog_category_bulk_create_job spawn_create_categories_job + # alias of `get_item_ids_for_catalog_category` + alias get_catalog_category_relationships_items get_item_ids_for_catalog_category - # Spawn Create Categories Job - # Create a catalog category bulk create job to create a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_create_job_create_query [CatalogCategoryCreateJobCreateQuery] + # Get Item IDs for Catalog Category + # Get all items in the given category ID. Returns a maximum of 100 items per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_create_categories_job_with_http_info(catalog_category_create_job_create_query, opts = {}) + def get_item_ids_for_catalog_category_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_create_categories_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_item_ids_for_catalog_category ...' end - # verify the required parameter 'catalog_category_create_job_create_query' is set - if @api_client.config.client_side_validation && catalog_category_create_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_create_job_create_query' when calling CatalogsApi.spawn_create_categories_job" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.get_item_ids_for_catalog_category" end # resource path - local_var_path = '/api/catalog-category-bulk-create-jobs/' + local_var_path = '/api/catalog-categories/{id}/relationships/items'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_create_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3241,7 +3289,7 @@ def spawn_create_categories_job_with_http_info(catalog_category_create_job_creat auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_create_categories_job", + :operation => :"CatalogsApi.get_item_ids_for_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3250,65 +3298,90 @@ def spawn_create_categories_job_with_http_info(catalog_category_create_job_creat :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_create_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_item_ids_for_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_create_categories_job_with_http_info` - alias create_catalog_category_bulk_create_job_with_http_info spawn_create_categories_job_with_http_info + # alias of `get_item_ids_for_catalog_category_with_http_info` + alias get_catalog_category_relationships_items_with_http_info get_item_ids_for_catalog_category_with_http_info - # Spawn Create Items Job - # Create a catalog item bulk create job to create a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_create_job_create_query [CatalogItemCreateJobCreateQuery] + # Get Items for Catalog Category + # Get all items in a category with the given category ID. Items can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 items per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def spawn_create_items_job(catalog_item_create_job_create_query, opts = {}) - data, _status_code, _headers = spawn_create_items_job_with_http_info(catalog_item_create_job_create_query, opts) + def get_items_for_catalog_category(id, opts = {}) + data, _status_code, _headers = get_items_for_catalog_category_with_http_info(id, opts) data end - # alias of `spawn_create_items_job` - alias create_catalog_item_bulk_create_job spawn_create_items_job + # alias of `get_items_for_catalog_category` + alias get_catalog_category_items get_items_for_catalog_category - # Spawn Create Items Job - # Create a catalog item bulk create job to create a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_create_job_create_query [CatalogItemCreateJobCreateQuery] + # Get Items for Catalog Category + # Get all items in a category with the given category ID. Items can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 items per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category.id`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_create_items_job_with_http_info(catalog_item_create_job_create_query, opts = {}) + def get_items_for_catalog_category_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_create_items_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_items_for_catalog_category ...' end - # verify the required parameter 'catalog_item_create_job_create_query' is set - if @api_client.config.client_side_validation && catalog_item_create_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_create_job_create_query' when calling CatalogsApi.spawn_create_items_job" + allowable_values = ["external_id", "title", "description", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" + end + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + end + allowable_values = ["variants"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-create-jobs/' + local_var_path = '/api/catalog-categories/{id}/items'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_create_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3317,7 +3390,7 @@ def spawn_create_items_job_with_http_info(catalog_item_create_job_create_query, auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_create_items_job", + :operation => :"CatalogsApi.get_items_for_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3326,65 +3399,81 @@ def spawn_create_items_job_with_http_info(catalog_item_create_job_create_query, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_create_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_items_for_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_create_items_job_with_http_info` - alias create_catalog_item_bulk_create_job_with_http_info spawn_create_items_job_with_http_info + # alias of `get_items_for_catalog_category_with_http_info` + alias get_catalog_category_items_with_http_info get_items_for_catalog_category_with_http_info - # Spawn Create Variants Job - # Create a catalog variant bulk create job to create a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_create_job_create_query [CatalogVariantCreateJobCreateQuery] + # Get Update Categories Job + # Get a catalog category bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def spawn_create_variants_job(catalog_variant_create_job_create_query, opts = {}) - data, _status_code, _headers = spawn_create_variants_job_with_http_info(catalog_variant_create_job_create_query, opts) + def get_update_categories_job(job_id, opts = {}) + data, _status_code, _headers = get_update_categories_job_with_http_info(job_id, opts) data end - # alias of `spawn_create_variants_job` - alias create_catalog_variant_bulk_create_job spawn_create_variants_job + # alias of `get_update_categories_job` + alias get_catalog_category_bulk_update_job get_update_categories_job - # Spawn Create Variants Job - # Create a catalog variant bulk create job to create a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_create_job_create_query [CatalogVariantCreateJobCreateQuery] + # Get Update Categories Job + # Get a catalog category bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `categories`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_create_variants_job_with_http_info(catalog_variant_create_job_create_query, opts = {}) + def get_update_categories_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_create_variants_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_categories_job ...' end - # verify the required parameter 'catalog_variant_create_job_create_query' is set - if @api_client.config.client_side_validation && catalog_variant_create_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_variant_create_job_create_query' when calling CatalogsApi.spawn_create_variants_job" + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_categories_job" + end + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_update_job'] && !opts[:'fields_catalog_category_bulk_update_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_update_job\", must include one of #{allowable_values}" + end + allowable_values = ["external_id", "name", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" + end + allowable_values = ["categories"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-create-jobs/' + local_var_path = '/api/catalog-category-bulk-update-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[catalog-category-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_update_job'], :csv) if !opts[:'fields_catalog_category_bulk_update_job'].nil? + query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_create_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3393,7 +3482,7 @@ def spawn_create_variants_job_with_http_info(catalog_variant_create_job_create_q auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_create_variants_job", + :operation => :"CatalogsApi.get_update_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3402,65 +3491,67 @@ def spawn_create_variants_job_with_http_info(catalog_variant_create_job_create_q :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_create_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_update_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_create_variants_job_with_http_info` - alias create_catalog_variant_bulk_create_job_with_http_info spawn_create_variants_job_with_http_info + # alias of `get_update_categories_job_with_http_info` + alias get_catalog_category_bulk_update_job_with_http_info get_update_categories_job_with_http_info - # Spawn Delete Categories Job - # Create a catalog category bulk delete job to delete a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_delete_job_create_query [CatalogCategoryDeleteJobCreateQuery] + # Get Update Categories Jobs + # Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def spawn_delete_categories_job(catalog_category_delete_job_create_query, opts = {}) - data, _status_code, _headers = spawn_delete_categories_job_with_http_info(catalog_category_delete_job_create_query, opts) + def get_update_categories_jobs(opts = {}) + data, _status_code, _headers = get_update_categories_jobs_with_http_info(opts) data end - # alias of `spawn_delete_categories_job` - alias create_catalog_category_bulk_delete_job spawn_delete_categories_job + # alias of `get_update_categories_jobs` + alias get_catalog_category_bulk_update_jobs get_update_categories_jobs - # Spawn Delete Categories Job - # Create a catalog category bulk delete job to delete a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_delete_job_create_query [CatalogCategoryDeleteJobCreateQuery] + # Get Update Categories Jobs + # Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_delete_categories_job_with_http_info(catalog_category_delete_job_create_query, opts = {}) + def get_update_categories_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_delete_categories_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_categories_jobs ...' end - # verify the required parameter 'catalog_category_delete_job_create_query' is set - if @api_client.config.client_side_validation && catalog_category_delete_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_delete_job_create_query' when calling CatalogsApi.spawn_delete_categories_job" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_update_job'] && !opts[:'fields_catalog_category_bulk_update_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_update_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-delete-jobs/' + local_var_path = '/api/catalog-category-bulk-update-jobs' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[catalog-category-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_update_job'], :csv) if !opts[:'fields_catalog_category_bulk_update_job'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_delete_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3469,7 +3560,7 @@ def spawn_delete_categories_job_with_http_info(catalog_category_delete_job_creat auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_delete_categories_job", + :operation => :"CatalogsApi.get_update_categories_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3478,65 +3569,81 @@ def spawn_delete_categories_job_with_http_info(catalog_category_delete_job_creat :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_delete_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_update_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_delete_categories_job_with_http_info` - alias create_catalog_category_bulk_delete_job_with_http_info spawn_delete_categories_job_with_http_info + # alias of `get_update_categories_jobs_with_http_info` + alias get_catalog_category_bulk_update_jobs_with_http_info get_update_categories_jobs_with_http_info - # Spawn Delete Items Job - # Create a catalog item bulk delete job to delete a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_delete_job_create_query [CatalogItemDeleteJobCreateQuery] + # Get Update Variants Job + # Get a catalog variate bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def spawn_delete_items_job(catalog_item_delete_job_create_query, opts = {}) - data, _status_code, _headers = spawn_delete_items_job_with_http_info(catalog_item_delete_job_create_query, opts) + def get_update_variants_job(job_id, opts = {}) + data, _status_code, _headers = get_update_variants_job_with_http_info(job_id, opts) data end - # alias of `spawn_delete_items_job` - alias create_catalog_item_bulk_delete_job spawn_delete_items_job + # alias of `get_update_variants_job` + alias get_catalog_variant_bulk_update_job get_update_variants_job - # Spawn Delete Items Job - # Create a catalog item bulk delete job to delete a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_delete_job_create_query [CatalogItemDeleteJobCreateQuery] + # Get Update Variants Job + # Get a catalog variate bulk update job with the given job ID. An `include` parameter can be provided to get the following related resource data: `variants`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_delete_items_job_with_http_info(catalog_item_delete_job_create_query, opts = {}) + def get_update_variants_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_delete_items_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_variants_job ...' + end + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_variants_job" + end + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_update_job'] && !opts[:'fields_catalog_variant_bulk_update_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_update_job\", must include one of #{allowable_values}" + end + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end - # verify the required parameter 'catalog_item_delete_job_create_query' is set - if @api_client.config.client_side_validation && catalog_item_delete_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_delete_job_create_query' when calling CatalogsApi.spawn_delete_items_job" + allowable_values = ["variants"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-item-bulk-delete-jobs/' + local_var_path = '/api/catalog-variant-bulk-update-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[catalog-variant-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_update_job'], :csv) if !opts[:'fields_catalog_variant_bulk_update_job'].nil? + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_delete_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3545,7 +3652,7 @@ def spawn_delete_items_job_with_http_info(catalog_item_delete_job_create_query, auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_delete_items_job", + :operation => :"CatalogsApi.get_update_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3554,65 +3661,67 @@ def spawn_delete_items_job_with_http_info(catalog_item_delete_job_create_query, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_delete_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_update_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_delete_items_job_with_http_info` - alias create_catalog_item_bulk_delete_job_with_http_info spawn_delete_items_job_with_http_info + # alias of `get_update_variants_job_with_http_info` + alias get_catalog_variant_bulk_update_job_with_http_info get_update_variants_job_with_http_info - # Spawn Delete Variants Job - # Create a catalog variant bulk delete job to delete a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_delete_job_create_query [CatalogVariantDeleteJobCreateQuery] + # Get Update Variants Jobs + # Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def spawn_delete_variants_job(catalog_variant_delete_job_create_query, opts = {}) - data, _status_code, _headers = spawn_delete_variants_job_with_http_info(catalog_variant_delete_job_create_query, opts) + def get_update_variants_jobs(opts = {}) + data, _status_code, _headers = get_update_variants_jobs_with_http_info(opts) data end - # alias of `spawn_delete_variants_job` - alias create_catalog_variant_bulk_delete_job spawn_delete_variants_job + # alias of `get_update_variants_jobs` + alias get_catalog_variant_bulk_update_jobs get_update_variants_jobs - # Spawn Delete Variants Job - # Create a catalog variant bulk delete job to delete a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_delete_job_create_query [CatalogVariantDeleteJobCreateQuery] + # Get Update Variants Jobs + # Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_delete_variants_job_with_http_info(catalog_variant_delete_job_create_query, opts = {}) + def get_update_variants_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_delete_variants_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_variants_jobs ...' end - # verify the required parameter 'catalog_variant_delete_job_create_query' is set - if @api_client.config.client_side_validation && catalog_variant_delete_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_variant_delete_job_create_query' when calling CatalogsApi.spawn_delete_variants_job" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_update_job'] && !opts[:'fields_catalog_variant_bulk_update_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_update_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-variant-bulk-delete-jobs/' + local_var_path = '/api/catalog-variant-bulk-update-jobs' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[catalog-variant-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_update_job'], :csv) if !opts[:'fields_catalog_variant_bulk_update_job'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_delete_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3621,7 +3730,7 @@ def spawn_delete_variants_job_with_http_info(catalog_variant_delete_job_create_q auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_delete_variants_job", + :operation => :"CatalogsApi.get_update_variants_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3630,65 +3739,76 @@ def spawn_delete_variants_job_with_http_info(catalog_variant_delete_job_create_q :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_delete_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_update_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_delete_variants_job_with_http_info` - alias create_catalog_variant_bulk_delete_job_with_http_info spawn_delete_variants_job_with_http_info + # alias of `get_update_variants_jobs_with_http_info` + alias get_catalog_variant_bulk_update_jobs_with_http_info get_update_variants_jobs_with_http_info - # Spawn Update Categories Job - # Create a catalog category bulk update job to update a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_update_job_create_query [CatalogCategoryUpdateJobCreateQuery] + # Get Variants for Catalog Item + # Get all variants related to the given item ID. Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def spawn_update_categories_job(catalog_category_update_job_create_query, opts = {}) - data, _status_code, _headers = spawn_update_categories_job_with_http_info(catalog_category_update_job_create_query, opts) + def get_variants_for_catalog_item(id, opts = {}) + data, _status_code, _headers = get_variants_for_catalog_item_with_http_info(id, opts) data end - # alias of `spawn_update_categories_job` - alias create_catalog_category_bulk_update_job spawn_update_categories_job + # alias of `get_variants_for_catalog_item` + alias get_catalog_item_variants get_variants_for_catalog_item - # Spawn Update Categories Job - # Create a catalog category bulk update job to update a batch of catalog categories. Accepts up to 100 catalog categories per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_category_update_job_create_query [CatalogCategoryUpdateJobCreateQuery] + # Get Variants for Catalog Item + # Get all variants related to the given item ID. Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `catalogs:read` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item.id`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_update_categories_job_with_http_info(catalog_category_update_job_create_query, opts = {}) + def get_variants_for_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_update_categories_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.get_variants_for_catalog_item ...' end - # verify the required parameter 'catalog_category_update_job_create_query' is set - if @api_client.config.client_side_validation && catalog_category_update_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_update_job_create_query' when calling CatalogsApi.spawn_update_categories_job" + allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" + end + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/catalog-category-bulk-update-jobs/' + local_var_path = '/api/catalog-items/{id}/variants'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_update_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -3697,7 +3817,7 @@ def spawn_update_categories_job_with_http_info(catalog_category_update_job_creat auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_update_categories_job", + :operation => :"CatalogsApi.get_variants_for_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3706,44 +3826,50 @@ def spawn_update_categories_job_with_http_info(catalog_category_update_job_creat :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_update_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#get_variants_for_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_update_categories_job_with_http_info` - alias create_catalog_category_bulk_update_job_with_http_info spawn_update_categories_job_with_http_info + # alias of `get_variants_for_catalog_item_with_http_info` + alias get_catalog_item_variants_with_http_info get_variants_for_catalog_item_with_http_info - # Spawn Update Items Job - # Create a catalog item bulk update job to update a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_update_job_create_query [CatalogItemUpdateJobCreateQuery] + # Remove Categories from Catalog Item + # Delete catalog category relationships for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def spawn_update_items_job(catalog_item_update_job_create_query, opts = {}) - data, _status_code, _headers = spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, opts) - data + # @return [nil] + def remove_categories_from_catalog_item(id, catalog_item_category_op, opts = {}) + remove_categories_from_catalog_item_with_http_info(id, catalog_item_category_op, opts) + nil end - # alias of `spawn_update_items_job` - alias create_catalog_item_bulk_update_job spawn_update_items_job + # alias of `remove_categories_from_catalog_item` + alias delete_catalog_item_relationships_categories remove_categories_from_catalog_item - # Spawn Update Items Job - # Create a catalog item bulk update job to update a batch of catalog items. Accepts up to 100 catalog items per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_item_update_job_create_query [CatalogItemUpdateJobCreateQuery] + # Remove Categories from Catalog Item + # Delete catalog category relationships for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_categories_from_catalog_item_with_http_info(id, catalog_item_category_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_update_items_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.remove_categories_from_catalog_item ...' end - # verify the required parameter 'catalog_item_update_job_create_query' is set - if @api_client.config.client_side_validation && catalog_item_update_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_update_job_create_query' when calling CatalogsApi.spawn_update_items_job" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.remove_categories_from_catalog_item" + end + # verify the required parameter 'catalog_item_category_op' is set + if @api_client.config.client_side_validation && catalog_item_category_op.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.remove_categories_from_catalog_item" end # resource path - local_var_path = '/api/catalog-item-bulk-update-jobs/' + local_var_path = '/api/catalog-items/{id}/relationships/categories'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -3751,11 +3877,11 @@ def spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -3764,16 +3890,16 @@ def spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_update_job_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_update_items_job", + :operation => :"CatalogsApi.remove_categories_from_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3782,44 +3908,50 @@ def spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_update_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#remove_categories_from_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_update_items_job_with_http_info` - alias create_catalog_item_bulk_update_job_with_http_info spawn_update_items_job_with_http_info + # alias of `remove_categories_from_catalog_item_with_http_info` + alias delete_catalog_item_relationships_categories_with_http_info remove_categories_from_catalog_item_with_http_info - # Spawn Update Variants Job - # Create a catalog variant bulk update job to update a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_update_job_create_query [CatalogVariantUpdateJobCreateQuery] + # Remove Items from Catalog Category + # Delete item relationships for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def spawn_update_variants_job(catalog_variant_update_job_create_query, opts = {}) - data, _status_code, _headers = spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_query, opts) - data + # @return [nil] + def remove_items_from_catalog_category(id, catalog_category_item_op, opts = {}) + remove_items_from_catalog_category_with_http_info(id, catalog_category_item_op, opts) + nil end - # alias of `spawn_update_variants_job` - alias create_catalog_variant_bulk_update_job spawn_update_variants_job + # alias of `remove_items_from_catalog_category` + alias delete_catalog_category_relationships_items remove_items_from_catalog_category - # Spawn Update Variants Job - # Create a catalog variant bulk update job to update a batch of catalog variants. Accepts up to 100 catalog variants per request. The maximum allowed payload size is 5MB. The maximum number of jobs in progress at one time is 500.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param catalog_variant_update_job_create_query [CatalogVariantUpdateJobCreateQuery] + # Remove Items from Catalog Category + # Delete item relationships for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_query, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_items_from_catalog_category_with_http_info(id, catalog_category_item_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_update_variants_job ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.remove_items_from_catalog_category ...' end - # verify the required parameter 'catalog_variant_update_job_create_query' is set - if @api_client.config.client_side_validation && catalog_variant_update_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_variant_update_job_create_query' when calling CatalogsApi.spawn_update_variants_job" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.remove_items_from_catalog_category" + end + # verify the required parameter 'catalog_category_item_op' is set + if @api_client.config.client_side_validation && catalog_category_item_op.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.remove_items_from_catalog_category" end # resource path - local_var_path = '/api/catalog-variant-bulk-update-jobs/' + local_var_path = '/api/catalog-categories/{id}/relationships/items'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -3827,11 +3959,11 @@ def spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_q # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -3840,16 +3972,16 @@ def spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_q form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_update_job_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.spawn_update_variants_job", + :operation => :"CatalogsApi.remove_items_from_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3858,15 +3990,15 @@ def spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_q :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#spawn_update_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#remove_items_from_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_update_variants_job_with_http_info` - alias create_catalog_variant_bulk_update_job_with_http_info spawn_update_variants_job_with_http_info + # alias of `remove_items_from_catalog_category_with_http_info` + alias delete_catalog_category_relationships_items_with_http_info remove_items_from_catalog_category_with_http_info # Update Catalog Category # Update a catalog category with the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` @@ -3898,7 +4030,7 @@ def update_catalog_category_with_http_info(id, catalog_category_update_query, op fail ArgumentError, "Missing the required parameter 'catalog_category_update_query' when calling CatalogsApi.update_catalog_category" end # resource path - local_var_path = '/api/catalog-categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-categories/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -3906,11 +4038,11 @@ def update_catalog_category_with_http_info(id, catalog_category_update_query, op # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -3944,37 +4076,37 @@ def update_catalog_category_with_http_info(id, catalog_category_update_query, op return data, status_code, headers end - # Update Catalog Category Relationships Items - # Update item relationships for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_category_item_op [CatalogCategoryItemOp] + # Update Catalog Item + # Update a catalog item with the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_item_update_query [CatalogItemUpdateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def update_catalog_category_relationships_items(id, catalog_category_item_op, opts = {}) - update_catalog_category_relationships_items_with_http_info(id, catalog_category_item_op, opts) - nil + # @return [Hash] + def update_catalog_item(id, catalog_item_update_query, opts = {}) + data, _status_code, _headers = update_catalog_item_with_http_info(id, catalog_item_update_query, opts) + data end - # Update Catalog Category Relationships Items - # Update item relationships for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] - # @param catalog_category_item_op [CatalogCategoryItemOp] + # Update Catalog Item + # Update a catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_item_update_query [CatalogItemUpdateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_catalog_category_relationships_items_with_http_info(id, catalog_category_item_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_category_relationships_items ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_item ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_catalog_category_relationships_items" + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_catalog_item" end - # verify the required parameter 'catalog_category_item_op' is set - if @api_client.config.client_side_validation && catalog_category_item_op.nil? - fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.update_catalog_category_relationships_items" + # verify the required parameter 'catalog_item_update_query' is set + if @api_client.config.client_side_validation && catalog_item_update_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_item_update_query' when calling CatalogsApi.update_catalog_item" end # resource path - local_var_path = '/api/catalog-categories/{id}/relationships/items/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-items/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -3982,11 +4114,11 @@ def update_catalog_category_relationships_items_with_http_info(id, catalog_categ # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -3995,16 +4127,16 @@ def update_catalog_category_relationships_items_with_http_info(id, catalog_categ form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_update_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.update_catalog_category_relationships_items", + :operation => :"CatalogsApi.update_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -4015,42 +4147,42 @@ def update_catalog_category_relationships_items_with_http_info(id, catalog_categ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_category_relationships_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update Catalog Item - # Update a catalog item with the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. - # @param catalog_item_update_query [CatalogItemUpdateQuery] + # Update Catalog Variant + # Update a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_variant_update_query [CatalogVariantUpdateQuery] # @param [Hash] opts the optional parameters # @return [Hash] - def update_catalog_item(id, catalog_item_update_query, opts = {}) - data, _status_code, _headers = update_catalog_item_with_http_info(id, catalog_item_update_query, opts) + def update_catalog_variant(id, catalog_variant_update_query, opts = {}) + data, _status_code, _headers = update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts) data end - # Update Catalog Item - # Update a catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. - # @param catalog_item_update_query [CatalogItemUpdateQuery] + # Update Catalog Variant + # Update a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_variant_update_query [CatalogVariantUpdateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) + def update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_item ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_variant ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_catalog_item" + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_catalog_variant" end - # verify the required parameter 'catalog_item_update_query' is set - if @api_client.config.client_side_validation && catalog_item_update_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_update_query' when calling CatalogsApi.update_catalog_item" + # verify the required parameter 'catalog_variant_update_query' is set + if @api_client.config.client_side_validation && catalog_variant_update_query.nil? + fail ArgumentError, "Missing the required parameter 'catalog_variant_update_query' when calling CatalogsApi.update_catalog_variant" end # resource path - local_var_path = '/api/catalog-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-variants/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -4058,11 +4190,11 @@ def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -4071,7 +4203,7 @@ def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_update_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_update_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -4080,7 +4212,7 @@ def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.update_catalog_item", + :operation => :"CatalogsApi.update_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -4091,42 +4223,45 @@ def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update Catalog Item Relationships Categories + # Update Categories for Catalog Item # Update catalog category relationships for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [nil] - def update_catalog_item_relationships_categories(id, catalog_item_category_op, opts = {}) - update_catalog_item_relationships_categories_with_http_info(id, catalog_item_category_op, opts) + def update_categories_for_catalog_item(id, catalog_item_category_op, opts = {}) + update_categories_for_catalog_item_with_http_info(id, catalog_item_category_op, opts) nil end - # Update Catalog Item Relationships Categories + # alias of `update_categories_for_catalog_item` + alias update_catalog_item_relationships_categories update_categories_for_catalog_item + + # Update Categories for Catalog Item # Update catalog category relationships for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] + # @param id [String] The catalog item ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_catalog_item_relationships_categories_with_http_info(id, catalog_item_category_op, opts = {}) + def update_categories_for_catalog_item_with_http_info(id, catalog_item_category_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_item_relationships_categories ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.update_categories_for_catalog_item ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_catalog_item_relationships_categories" + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_categories_for_catalog_item" end # verify the required parameter 'catalog_item_category_op' is set if @api_client.config.client_side_validation && catalog_item_category_op.nil? - fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.update_catalog_item_relationships_categories" + fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.update_categories_for_catalog_item" end # resource path - local_var_path = '/api/catalog-items/{id}/relationships/categories/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-items/{id}/relationships/categories'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -4134,11 +4269,11 @@ def update_catalog_item_relationships_categories_with_http_info(id, catalog_item # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -4156,7 +4291,7 @@ def update_catalog_item_relationships_categories_with_http_info(id, catalog_item auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.update_catalog_item_relationships_categories", + :operation => :"CatalogsApi.update_categories_for_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -4167,42 +4302,48 @@ def update_catalog_item_relationships_categories_with_http_info(id, catalog_item data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_item_relationships_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#update_categories_for_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update Catalog Variant - # Update a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. - # @param catalog_variant_update_query [CatalogVariantUpdateQuery] + # alias of `update_categories_for_catalog_item_with_http_info` + alias update_catalog_item_relationships_categories_with_http_info update_categories_for_catalog_item_with_http_info + + # Update Items for Catalog Category + # Update item relationships for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def update_catalog_variant(id, catalog_variant_update_query, opts = {}) - data, _status_code, _headers = update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts) - data + # @return [nil] + def update_items_for_catalog_category(id, catalog_category_item_op, opts = {}) + update_items_for_catalog_category_with_http_info(id, catalog_category_item_op, opts) + nil end - # Update Catalog Variant - # Update a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` - # @param id [String] The catalog variant ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. - # @param catalog_variant_update_query [CatalogVariantUpdateQuery] + # alias of `update_items_for_catalog_category` + alias update_catalog_category_relationships_items update_items_for_catalog_category + + # Update Items for Catalog Category + # Update item relationships for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `catalogs:write` + # @param id [String] The catalog category ID is a compound ID (string), with format: `{integration}:::{catalog}:::{external_id}`. Currently, the only supported integration type is `$custom`, and the only supported catalog is `$default`. + # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_items_for_catalog_category_with_http_info(id, catalog_category_item_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_variant ...' + @api_client.config.logger.debug 'Calling API: CatalogsApi.update_items_for_catalog_category ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_catalog_variant" + fail ArgumentError, "Missing the required parameter 'id' when calling CatalogsApi.update_items_for_catalog_category" end - # verify the required parameter 'catalog_variant_update_query' is set - if @api_client.config.client_side_validation && catalog_variant_update_query.nil? - fail ArgumentError, "Missing the required parameter 'catalog_variant_update_query' when calling CatalogsApi.update_catalog_variant" + # verify the required parameter 'catalog_category_item_op' is set + if @api_client.config.client_side_validation && catalog_category_item_op.nil? + fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.update_items_for_catalog_category" end # resource path - local_var_path = '/api/catalog-variants/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/catalog-categories/{id}/relationships/items'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -4210,11 +4351,11 @@ def update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -4223,16 +4364,16 @@ def update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_update_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CatalogsApi.update_catalog_variant", + :operation => :"CatalogsApi.update_items_for_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -4243,9 +4384,12 @@ def update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CatalogsApi#update_items_for_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + + # alias of `update_items_for_catalog_category_with_http_info` + alias update_catalog_category_relationships_items_with_http_info update_items_for_catalog_category_with_http_info end end diff --git a/lib/klaviyo-api-sdk/api/coupons_api.rb b/lib/klaviyo-api-sdk/api/coupons_api.rb index 3abce5d..feb6614 100644 --- a/lib/klaviyo-api-sdk/api/coupons_api.rb +++ b/lib/klaviyo-api-sdk/api/coupons_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -19,6 +19,88 @@ class CouponsApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Bulk Create Coupon Codes + # Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:write` + # @param coupon_code_create_job_create_query [CouponCodeCreateJobCreateQuery] + # @param [Hash] opts the optional parameters + # @return [Hash] + def bulk_create_coupon_codes(coupon_code_create_job_create_query, opts = {}) + data, _status_code, _headers = bulk_create_coupon_codes_with_http_info(coupon_code_create_job_create_query, opts) + data + end + + # alias of `bulk_create_coupon_codes` + alias spawn_coupon_code_bulk_create_job bulk_create_coupon_codes + + # alias of `bulk_create_coupon_codes` + alias create_coupon_code_bulk_create_job bulk_create_coupon_codes + + # Bulk Create Coupon Codes + # Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:write` + # @param coupon_code_create_job_create_query [CouponCodeCreateJobCreateQuery] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_create_coupon_codes_with_http_info(coupon_code_create_job_create_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CouponsApi.bulk_create_coupon_codes ...' + end + # verify the required parameter 'coupon_code_create_job_create_query' is set + if @api_client.config.client_side_validation && coupon_code_create_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'coupon_code_create_job_create_query' when calling CouponsApi.bulk_create_coupon_codes" + end + # resource path + local_var_path = '/api/coupon-code-bulk-create-jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(coupon_code_create_job_create_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"CouponsApi.bulk_create_coupon_codes", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CouponsApi#bulk_create_coupon_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `bulk_create_coupon_codes_with_http_info` + alias spawn_coupon_code_bulk_create_job_with_http_info bulk_create_coupon_codes_with_http_info + + # alias of `bulk_create_coupon_codes_with_http_info` + alias create_coupon_code_bulk_create_job_with_http_info bulk_create_coupon_codes_with_http_info + # Create Coupon # Creates a new coupon.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `coupons:write` # @param coupon_create_query [CouponCreateQuery] @@ -43,7 +125,7 @@ def create_coupon_with_http_info(coupon_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'coupon_create_query' when calling CouponsApi.create_coupon" end # resource path - local_var_path = '/api/coupons/' + local_var_path = '/api/coupons' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +133,11 @@ def create_coupon_with_http_info(coupon_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -113,7 +195,7 @@ def create_coupon_code_with_http_info(coupon_code_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'coupon_code_create_query' when calling CouponsApi.create_coupon_code" end # resource path - local_var_path = '/api/coupon-codes/' + local_var_path = '/api/coupon-codes' # query parameters query_params = opts[:query_params] || {} @@ -121,11 +203,11 @@ def create_coupon_code_with_http_info(coupon_code_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -183,7 +265,7 @@ def delete_coupon_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.delete_coupon" end # resource path - local_var_path = '/api/coupons/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -191,9 +273,9 @@ def delete_coupon_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -248,7 +330,7 @@ def delete_coupon_code_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.delete_coupon_code" end # resource path - local_var_path = '/api/coupon-codes/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-codes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -256,9 +338,9 @@ def delete_coupon_code_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -289,48 +371,51 @@ def delete_coupon_code_with_http_info(id, opts = {}) return data, status_code, headers end - # Get Coupon - # Get a specific coupon with the given coupon ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupons:read` - # @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration. + # Get Bulk Create Coupon Code Jobs + # Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_coupon(id, opts = {}) - data, _status_code, _headers = get_coupon_with_http_info(id, opts) + def get_bulk_create_coupon_code_jobs(opts = {}) + data, _status_code, _headers = get_bulk_create_coupon_code_jobs_with_http_info(opts) data end - # Get Coupon - # Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read` - # @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration. + # alias of `get_bulk_create_coupon_code_jobs` + alias get_coupon_code_bulk_create_jobs get_bulk_create_coupon_code_jobs + + # Get Bulk Create Coupon Code Jobs + # Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_coupon_with_http_info(id, opts = {}) + def get_bulk_create_coupon_code_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon ...' + @api_client.config.logger.debug 'Calling API: CouponsApi.get_bulk_create_coupon_code_jobs ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon" - end - allowable_values = ["external_id", "description"] - if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}" + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupons/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-code-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil? + query_params[:'fields[coupon-code-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_coupon_code_bulk_create_job'], :csv) if !opts[:'fields_coupon_code_bulk_create_job'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -345,7 +430,7 @@ def get_coupon_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CouponsApi.get_coupon", + :operation => :"CouponsApi.get_bulk_create_coupon_code_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -356,67 +441,73 @@ def get_coupon_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#get_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CouponsApi#get_bulk_create_coupon_code_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Coupon Code - # Returns a Coupon Code specified by the given identifier.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:read` - # @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. + # alias of `get_bulk_create_coupon_code_jobs_with_http_info` + alias get_coupon_code_bulk_create_jobs_with_http_info get_bulk_create_coupon_code_jobs_with_http_info + + # Get Bulk Create Coupon Codes Job + # Get a coupon code bulk create job with the given job ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_coupon_code(id, opts = {}) - data, _status_code, _headers = get_coupon_code_with_http_info(id, opts) + def get_bulk_create_coupon_codes_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_create_coupon_codes_job_with_http_info(job_id, opts) data end - # Get Coupon Code - # Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` - # @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. + # alias of `get_bulk_create_coupon_codes_job` + alias get_coupon_code_bulk_create_job get_bulk_create_coupon_codes_job + + # Get Bulk Create Coupon Codes Job + # Get a coupon code bulk create job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_coupon_code_with_http_info(id, opts = {}) + def get_bulk_create_coupon_codes_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code ...' + @api_client.config.logger.debug 'Calling API: CouponsApi.get_bulk_create_coupon_codes_job ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code" + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling CouponsApi.get_bulk_create_coupon_codes_job" + end + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] + if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}" end allowable_values = ["unique_code", "expires_at", "status"] if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}" end - allowable_values = ["external_id", "description"] - if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}" - end - allowable_values = ["coupon"] + allowable_values = ["coupon-codes"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupon-codes/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-code-bulk-create-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[coupon-code-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_coupon_code_bulk_create_job'], :csv) if !opts[:'fields_coupon_code_bulk_create_job'].nil? query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil? - query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -431,7 +522,7 @@ def get_coupon_code_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CouponsApi.get_coupon_code", + :operation => :"CouponsApi.get_bulk_create_coupon_codes_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -442,67 +533,55 @@ def get_coupon_code_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#get_coupon_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CouponsApi#get_bulk_create_coupon_codes_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Coupon Code Bulk Create Job - # Get a coupon code bulk create job with the given job ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` - # @param job_id [String] ID of the job to retrieve. + # alias of `get_bulk_create_coupon_codes_job_with_http_info` + alias get_coupon_code_bulk_create_job_with_http_info get_bulk_create_coupon_codes_job_with_http_info + + # Get Code IDs for Coupon + # Gets a list of coupon code relationships associated with the given coupon id

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` + # @param id [String] The ID of the coupon to look up the relationship of. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] - def get_coupon_code_bulk_create_job(job_id, opts = {}) - data, _status_code, _headers = get_coupon_code_bulk_create_job_with_http_info(job_id, opts) + def get_code_ids_for_coupon(id, opts = {}) + data, _status_code, _headers = get_code_ids_for_coupon_with_http_info(id, opts) data end - # Get Coupon Code Bulk Create Job - # Get a coupon code bulk create job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` - # @param job_id [String] ID of the job to retrieve. + # alias of `get_code_ids_for_coupon` + alias get_coupon_code_relationships_coupon get_code_ids_for_coupon + + # Get Code IDs for Coupon + # Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` + # @param id [String] The ID of the coupon to look up the relationship of. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_coupon_code_bulk_create_job_with_http_info(job_id, opts = {}) + def get_code_ids_for_coupon_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code_bulk_create_job ...' - end - # verify the required parameter 'job_id' is set - if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling CouponsApi.get_coupon_code_bulk_create_job" - end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: CouponsApi.get_code_ids_for_coupon ...' end - allowable_values = ["unique_code", "expires_at", "status"] - if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}" - end - allowable_values = ["coupon-codes"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_code_ids_for_coupon" end # resource path - local_var_path = '/api/coupon-code-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/coupons/{id}/relationships/coupon-codes'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[coupon-code-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_coupon_code_bulk_create_job'], :csv) if !opts[:'fields_coupon_code_bulk_create_job'].nil? - query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -517,7 +596,7 @@ def get_coupon_code_bulk_create_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CouponsApi.get_coupon_code_bulk_create_job", + :operation => :"CouponsApi.get_code_ids_for_coupon", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -528,53 +607,56 @@ def get_coupon_code_bulk_create_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#get_coupon_code_bulk_create_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CouponsApi#get_code_ids_for_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Coupon Code Bulk Create Jobs - # Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` + # alias of `get_code_ids_for_coupon_with_http_info` + alias get_coupon_code_relationships_coupon_with_http_info get_code_ids_for_coupon_with_http_info + + # Get Coupon + # Get a specific coupon with the given coupon ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupons:read` + # @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_coupon_code_bulk_create_jobs(opts = {}) - data, _status_code, _headers = get_coupon_code_bulk_create_jobs_with_http_info(opts) + def get_coupon(id, opts = {}) + data, _status_code, _headers = get_coupon_with_http_info(id, opts) data end - # Get Coupon Code Bulk Create Jobs - # Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` + # Get Coupon + # Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read` + # @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_coupon_code_bulk_create_jobs_with_http_info(opts = {}) + def get_coupon_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code_bulk_create_jobs ...' + @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon ...' end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "errors", "expires_at"] - if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon" + end + allowable_values = ["external_id", "description"] + if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupon-code-bulk-create-jobs/' + local_var_path = '/api/coupons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[coupon-code-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_coupon_code_bulk_create_job'], :csv) if !opts[:'fields_coupon_code_bulk_create_job'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -589,7 +671,7 @@ def get_coupon_code_bulk_create_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CouponsApi.get_coupon_code_bulk_create_jobs", + :operation => :"CouponsApi.get_coupon", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -600,49 +682,67 @@ def get_coupon_code_bulk_create_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#get_coupon_code_bulk_create_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CouponsApi#get_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Coupon Code Relationships Coupon - # Gets a list of coupon code relationships associated with the given coupon id

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` - # @param id [String] + # Get Coupon Code + # Returns a Coupon Code specified by the given identifier.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:read` + # @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_coupon_code_relationships_coupon(id, opts = {}) - data, _status_code, _headers = get_coupon_code_relationships_coupon_with_http_info(id, opts) + def get_coupon_code(id, opts = {}) + data, _status_code, _headers = get_coupon_code_with_http_info(id, opts) data end - # Get Coupon Code Relationships Coupon - # Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` - # @param id [String] + # Get Coupon Code + # Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` + # @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with. # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_coupon_code_relationships_coupon_with_http_info(id, opts = {}) + def get_coupon_code_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code_relationships_coupon ...' + @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_code ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code_relationships_coupon" + fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code" + end + allowable_values = ["unique_code", "expires_at", "status"] + if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}" + end + allowable_values = ["external_id", "description"] + if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}" + end + allowable_values = ["coupon"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupons/{id}/relationships/coupon-codes/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-codes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil? + query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -657,7 +757,7 @@ def get_coupon_code_relationships_coupon_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CouponsApi.get_coupon_code_relationships_coupon", + :operation => :"CouponsApi.get_coupon_code", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -668,7 +768,7 @@ def get_coupon_code_relationships_coupon_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#get_coupon_code_relationships_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CouponsApi#get_coupon_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -676,11 +776,11 @@ def get_coupon_code_relationships_coupon_with_http_info(id, opts = {}) # Get Coupon Codes # Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def get_coupon_codes(opts = {}) data, _status_code, _headers = get_coupon_codes_with_http_info(opts) @@ -690,11 +790,11 @@ def get_coupon_codes(opts = {}) # Get Coupon Codes # Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_coupon_codes_with_http_info(opts = {}) if @api_client.config.debugging @@ -713,7 +813,7 @@ def get_coupon_codes_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupon-codes/' + local_var_path = '/api/coupon-codes' # query parameters query_params = opts[:query_params] || {} @@ -726,9 +826,9 @@ def get_coupon_codes_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -763,9 +863,9 @@ def get_coupon_codes_with_http_info(opts = {}) # Gets a list of coupon codes associated with the given coupon id

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def get_coupon_codes_for_coupon(id, opts = {}) data, _status_code, _headers = get_coupon_codes_for_coupon_with_http_info(id, opts) @@ -779,9 +879,9 @@ def get_coupon_codes_for_coupon(id, opts = {}) # Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_coupon_codes_for_coupon_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -796,7 +896,7 @@ def get_coupon_codes_for_coupon_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupons/{id}/coupon-codes/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupons/{id}/coupon-codes'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -807,9 +907,9 @@ def get_coupon_codes_for_coupon_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -845,9 +945,9 @@ def get_coupon_codes_for_coupon_with_http_info(id, opts = {}) # Get Coupon For Coupon Code # Get the coupon associated with a given coupon code ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupons:read` - # @param id [String] + # @param id [String] The ID of the coupon to look up the relationship of. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_coupon_for_coupon_code(id, opts = {}) data, _status_code, _headers = get_coupon_for_coupon_code_with_http_info(id, opts) @@ -859,9 +959,9 @@ def get_coupon_for_coupon_code(id, opts = {}) # Get Coupon For Coupon Code # Get the coupon associated with a given coupon code ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read` - # @param id [String] + # @param id [String] The ID of the coupon to look up the relationship of. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_coupon_for_coupon_code_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -876,7 +976,7 @@ def get_coupon_for_coupon_code_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupon-codes/{id}/coupon/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-codes/{id}/coupon'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -885,9 +985,9 @@ def get_coupon_for_coupon_code_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -921,31 +1021,34 @@ def get_coupon_for_coupon_code_with_http_info(id, opts = {}) # alias of `get_coupon_for_coupon_code_with_http_info` alias get_coupon_code_coupon_with_http_info get_coupon_for_coupon_code_with_http_info - # Get Coupon Relationships Coupon Codes + # Get Coupon ID for Coupon Code # Gets the coupon relationship associated with the given coupon code id

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupons:read` - # @param id [String] + # @param id [String] The ID of the coupon code to look up the relationship of. # @param [Hash] opts the optional parameters # @return [Hash] - def get_coupon_relationships_coupon_codes(id, opts = {}) - data, _status_code, _headers = get_coupon_relationships_coupon_codes_with_http_info(id, opts) + def get_coupon_id_for_coupon_code(id, opts = {}) + data, _status_code, _headers = get_coupon_id_for_coupon_code_with_http_info(id, opts) data end - # Get Coupon Relationships Coupon Codes + # alias of `get_coupon_id_for_coupon_code` + alias get_coupon_relationships_coupon_codes get_coupon_id_for_coupon_code + + # Get Coupon ID for Coupon Code # Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read` - # @param id [String] + # @param id [String] The ID of the coupon code to look up the relationship of. # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_coupon_relationships_coupon_codes_with_http_info(id, opts = {}) + def get_coupon_id_for_coupon_code_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_relationships_coupon_codes ...' + @api_client.config.logger.debug 'Calling API: CouponsApi.get_coupon_id_for_coupon_code ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_relationships_coupon_codes" + fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_id_for_coupon_code" end # resource path - local_var_path = '/api/coupon-codes/{id}/relationships/coupon/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-codes/{id}/relationships/coupon'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -953,9 +1056,9 @@ def get_coupon_relationships_coupon_codes_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -970,7 +1073,7 @@ def get_coupon_relationships_coupon_codes_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"CouponsApi.get_coupon_relationships_coupon_codes", + :operation => :"CouponsApi.get_coupon_id_for_coupon_code", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -981,16 +1084,19 @@ def get_coupon_relationships_coupon_codes_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#get_coupon_relationships_coupon_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: CouponsApi#get_coupon_id_for_coupon_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `get_coupon_id_for_coupon_code_with_http_info` + alias get_coupon_relationships_coupon_codes_with_http_info get_coupon_id_for_coupon_code_with_http_info + # Get Coupons # Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupons:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def get_coupons(opts = {}) data, _status_code, _headers = get_coupons_with_http_info(opts) @@ -1000,8 +1106,8 @@ def get_coupons(opts = {}) # Get Coupons # Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupons:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_coupons_with_http_info(opts = {}) if @api_client.config.debugging @@ -1012,7 +1118,7 @@ def get_coupons_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/coupons/' + local_var_path = '/api/coupons' # query parameters query_params = opts[:query_params] || {} @@ -1022,9 +1128,9 @@ def get_coupons_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1055,82 +1161,6 @@ def get_coupons_with_http_info(opts = {}) return data, status_code, headers end - # Spawn Coupon Code Bulk Create Job - # Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `coupon-codes:write` - # @param coupon_code_create_job_create_query [CouponCodeCreateJobCreateQuery] - # @param [Hash] opts the optional parameters - # @return [Hash] - def spawn_coupon_code_bulk_create_job(coupon_code_create_job_create_query, opts = {}) - data, _status_code, _headers = spawn_coupon_code_bulk_create_job_with_http_info(coupon_code_create_job_create_query, opts) - data - end - - # alias of `spawn_coupon_code_bulk_create_job` - alias create_coupon_code_bulk_create_job spawn_coupon_code_bulk_create_job - - # Spawn Coupon Code Bulk Create Job - # Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `coupon-codes:write` - # @param coupon_code_create_job_create_query [CouponCodeCreateJobCreateQuery] - # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_coupon_code_bulk_create_job_with_http_info(coupon_code_create_job_create_query, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CouponsApi.spawn_coupon_code_bulk_create_job ...' - end - # verify the required parameter 'coupon_code_create_job_create_query' is set - if @api_client.config.client_side_validation && coupon_code_create_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'coupon_code_create_job_create_query' when calling CouponsApi.spawn_coupon_code_bulk_create_job" - end - # resource path - local_var_path = '/api/coupon-code-bulk-create-jobs/' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(coupon_code_create_job_create_query) - - # return_type - return_type = opts[:debug_return_type] || 'Hash' - - # auth_names - auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] - - new_options = opts.merge( - :operation => :"CouponsApi.spawn_coupon_code_bulk_create_job", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CouponsApi#spawn_coupon_code_bulk_create_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # alias of `spawn_coupon_code_bulk_create_job_with_http_info` - alias create_coupon_code_bulk_create_job_with_http_info spawn_coupon_code_bulk_create_job_with_http_info - # Update Coupon # *Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `coupons:write` # @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration. @@ -1161,7 +1191,7 @@ def update_coupon_with_http_info(id, coupon_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'coupon_update_query' when calling CouponsApi.update_coupon" end # resource path - local_var_path = '/api/coupons/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1169,11 +1199,11 @@ def update_coupon_with_http_info(id, coupon_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1237,7 +1267,7 @@ def update_coupon_code_with_http_info(id, coupon_code_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'coupon_code_update_query' when calling CouponsApi.update_coupon_code" end # resource path - local_var_path = '/api/coupon-codes/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/coupon-codes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1245,11 +1275,11 @@ def update_coupon_code_with_http_info(id, coupon_code_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/data_privacy_api.rb b/lib/klaviyo-api-sdk/api/data_privacy_api.rb index 34d7b09..a2d6119 100644 --- a/lib/klaviyo-api-sdk/api/data_privacy_api.rb +++ b/lib/klaviyo-api-sdk/api/data_privacy_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -46,7 +46,7 @@ def request_profile_deletion_with_http_info(data_privacy_create_deletion_job_que fail ArgumentError, "Missing the required parameter 'data_privacy_create_deletion_job_query' when calling DataPrivacyApi.request_profile_deletion" end # resource path - local_var_path = '/api/data-privacy-deletion-jobs/' + local_var_path = '/api/data-privacy-deletion-jobs' # query parameters query_params = opts[:query_params] || {} @@ -54,11 +54,11 @@ def request_profile_deletion_with_http_info(data_privacy_create_deletion_job_que # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/events_api.rb b/lib/klaviyo-api-sdk/api/events_api.rb index 16718d6..665a59e 100644 --- a/lib/klaviyo-api-sdk/api/events_api.rb +++ b/lib/klaviyo-api-sdk/api/events_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -46,7 +46,7 @@ def bulk_create_events_with_http_info(events_bulk_create_job, opts = {}) fail ArgumentError, "Missing the required parameter 'events_bulk_create_job' when calling EventsApi.bulk_create_events" end # resource path - local_var_path = '/api/event-bulk-create-jobs/' + local_var_path = '/api/event-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} @@ -54,11 +54,11 @@ def bulk_create_events_with_http_info(events_bulk_create_job, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -119,7 +119,7 @@ def create_event_with_http_info(event_create_query_v2, opts = {}) fail ArgumentError, "Missing the required parameter 'event_create_query_v2' when calling EventsApi.create_event" end # resource path - local_var_path = '/api/events/' + local_var_path = '/api/events' # query parameters query_params = opts[:query_params] || {} @@ -127,11 +127,11 @@ def create_event_with_http_info(event_create_query_v2, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -169,10 +169,10 @@ def create_event_with_http_info(event_create_query_v2, opts = {}) # Get an event with the given event ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `events:read` # @param id [String] ID of the event # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_event(id, opts = {}) data, _status_code, _headers = get_event_with_http_info(id, opts) @@ -183,10 +183,10 @@ def get_event(id, opts = {}) # Get an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `events:read` # @param id [String] ID of the event # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_event_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -213,7 +213,7 @@ def get_event_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/events/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/events/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -225,9 +225,9 @@ def get_event_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -260,9 +260,9 @@ def get_event_with_http_info(id, opts = {}) # Get Event Metric # Get the metric for an event with the given event ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `metrics:read` - # @param id [String] + # @param id [String] ID of the event # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_event_metric(id, opts = {}) data, _status_code, _headers = get_event_metric_with_http_info(id, opts) @@ -271,9 +271,9 @@ def get_event_metric(id, opts = {}) # Get Event Metric # Get the metric for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` `metrics:read` - # @param id [String] + # @param id [String] ID of the event # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_event_metric_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -288,7 +288,7 @@ def get_event_metric_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/events/{id}/metric/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/events/{id}/metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -297,9 +297,9 @@ def get_event_metric_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -332,10 +332,10 @@ def get_event_metric_with_http_info(id, opts = {}) # Get Event Profile # Get the profile associated with an event with the given event ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `profiles:read` - # @param id [String] + # @param id [String] ID of the event # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_event_profile(id, opts = {}) data, _status_code, _headers = get_event_profile_with_http_info(id, opts) @@ -344,10 +344,10 @@ def get_event_profile(id, opts = {}) # Get Event Profile # Get the profile associated with an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` `profiles:read` - # @param id [String] + # @param id [String] ID of the event # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_event_profile_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -361,12 +361,12 @@ def get_event_profile_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/events/{id}/profile/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/events/{id}/profile'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -376,9 +376,9 @@ def get_event_profile_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -409,41 +409,76 @@ def get_event_profile_with_http_info(id, opts = {}) return data, status_code, headers end - # Get Event Relationships Metric - # Get a list of related Metrics for an Event

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `metrics:read` - # @param id [String] + # Get Events + # Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` Returns a maximum of 200 events per page.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_event_relationships_metric(id, opts = {}) - data, _status_code, _headers = get_event_relationships_metric_with_http_info(id, opts) + def get_events(opts = {}) + data, _status_code, _headers = get_events_with_http_info(opts) data end - # Get Event Relationships Metric - # Get a list of related Metrics for an Event<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` `metrics:read` - # @param id [String] + # Get Events + # Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` Returns a maximum of 200 events per page.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_event_relationships_metric_with_http_info(id, opts = {}) + def get_events_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: EventsApi.get_event_relationships_metric ...' + @api_client.config.logger.debug 'Calling API: EventsApi.get_events ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_event_relationships_metric" + allowable_values = ["timestamp", "event_properties", "datetime", "uuid"] + if @api_client.config.client_side_validation && opts[:'fields_event'] && !opts[:'fields_event'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_event\", must include one of #{allowable_values}" + end + allowable_values = ["name", "created", "updated", "integration"] + if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" + end + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties"] + if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" + end + allowable_values = ["attributions", "metric", "profile"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + allowable_values = ["datetime", "-datetime", "timestamp", "-timestamp"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/events/{id}/relationships/metric/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/events' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[event]'] = @api_client.build_collection_param(opts[:'fields_event'], :csv) if !opts[:'fields_event'].nil? + query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil? + query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -458,7 +493,7 @@ def get_event_relationships_metric_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"EventsApi.get_event_relationships_metric", + :operation => :"EventsApi.get_events", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -469,36 +504,39 @@ def get_event_relationships_metric_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: EventsApi#get_event_relationships_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Event Relationships Profile - # Get profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `profiles:read` - # @param id [String] + # Get Metric ID for Event + # Get a list of related Metrics for an Event

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `metrics:read` + # @param id [String] ID of the event # @param [Hash] opts the optional parameters # @return [Hash] - def get_event_relationships_profile(id, opts = {}) - data, _status_code, _headers = get_event_relationships_profile_with_http_info(id, opts) + def get_metric_id_for_event(id, opts = {}) + data, _status_code, _headers = get_metric_id_for_event_with_http_info(id, opts) data end - # Get Event Relationships Profile - # Get profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` `profiles:read` - # @param id [String] + # alias of `get_metric_id_for_event` + alias get_event_relationships_metric get_metric_id_for_event + + # Get Metric ID for Event + # Get a list of related Metrics for an Event<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` `metrics:read` + # @param id [String] ID of the event # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_event_relationships_profile_with_http_info(id, opts = {}) + def get_metric_id_for_event_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: EventsApi.get_event_relationships_profile ...' + @api_client.config.logger.debug 'Calling API: EventsApi.get_metric_id_for_event ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_event_relationships_profile" + fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_metric_id_for_event" end # resource path - local_var_path = '/api/events/{id}/relationships/profile/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/events/{id}/relationships/metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -506,9 +544,9 @@ def get_event_relationships_profile_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -523,7 +561,7 @@ def get_event_relationships_profile_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"EventsApi.get_event_relationships_profile", + :operation => :"EventsApi.get_metric_id_for_event", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -534,81 +572,52 @@ def get_event_relationships_profile_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: EventsApi#get_event_relationships_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: EventsApi#get_metric_id_for_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Events - # Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` Returns a maximum of 200 events per page.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` + # alias of `get_metric_id_for_event_with_http_info` + alias get_event_relationships_metric_with_http_info get_metric_id_for_event_with_http_info + + # Get Profile ID for Event + # Get profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `events:read` `profiles:read` + # @param id [String] ID of the event # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Hash] - def get_events(opts = {}) - data, _status_code, _headers = get_events_with_http_info(opts) + def get_profile_id_for_event(id, opts = {}) + data, _status_code, _headers = get_profile_id_for_event_with_http_info(id, opts) data end - # Get Events - # Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` Returns a maximum of 200 events per page.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` + # alias of `get_profile_id_for_event` + alias get_event_relationships_profile get_profile_id_for_event + + # Get Profile ID for Event + # Get profile [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `events:read` `profiles:read` + # @param id [String] ID of the event # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`profile_id`: `equals`<br>`profile`: `has`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_events_with_http_info(opts = {}) + def get_profile_id_for_event_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: EventsApi.get_events ...' - end - allowable_values = ["timestamp", "event_properties", "datetime", "uuid"] - if @api_client.config.client_side_validation && opts[:'fields_event'] && !opts[:'fields_event'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_event\", must include one of #{allowable_values}" - end - allowable_values = ["name", "created", "updated", "integration"] - if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" - end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties"] - if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" - end - allowable_values = ["attributions", "metric", "profile"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: EventsApi.get_profile_id_for_event ...' end - allowable_values = ["datetime", "-datetime", "timestamp", "-timestamp"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_profile_id_for_event" end # resource path - local_var_path = '/api/events/' + local_var_path = '/api/events/{id}/relationships/profile'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[event]'] = @api_client.build_collection_param(opts[:'fields_event'], :csv) if !opts[:'fields_event'].nil? - query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil? - query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -623,7 +632,7 @@ def get_events_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"EventsApi.get_events", + :operation => :"EventsApi.get_profile_id_for_event", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -634,9 +643,12 @@ def get_events_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: EventsApi#get_profile_id_for_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + + # alias of `get_profile_id_for_event_with_http_info` + alias get_event_relationships_profile_with_http_info get_profile_id_for_event_with_http_info end end diff --git a/lib/klaviyo-api-sdk/api/flows_api.rb b/lib/klaviyo-api-sdk/api/flows_api.rb index 55ce133..eb083f5 100644 --- a/lib/klaviyo-api-sdk/api/flows_api.rb +++ b/lib/klaviyo-api-sdk/api/flows_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -43,7 +43,7 @@ def delete_flow_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.delete_flow" end # resource path - local_var_path = '/api/flows/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -51,9 +51,9 @@ def delete_flow_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -84,69 +84,44 @@ def delete_flow_with_http_info(id, opts = {}) return data, status_code, headers end - # Get Flow - # Get a flow with the given flow ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # Get Action ID for Flow Message + # Get the [relationship](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships # @return [Hash] - def get_flow(id, opts = {}) - data, _status_code, _headers = get_flow_with_http_info(id, opts) + def get_action_id_for_flow_message(id, opts = {}) + data, _status_code, _headers = get_action_id_for_flow_message_with_http_info(id, opts) data end - # Get Flow - # Get a flow with the given flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_action_id_for_flow_message` + alias get_flow_message_relationships_action get_action_id_for_flow_message + + # Get Action ID for Flow Message + # Get the [relationship](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_with_http_info(id, opts = {}) + def get_action_id_for_flow_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_action_id_for_flow_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow" - end - allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] - if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" - end - allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] - if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" - end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" - end - allowable_values = ["flow-actions", "tags"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_action_id_for_flow_message" end # resource path - local_var_path = '/api/flows/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-messages/{id}/relationships/flow-action'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? - query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -161,7 +136,7 @@ def get_flow_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow", + :operation => :"FlowsApi.get_action_id_for_flow_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -172,74 +147,73 @@ def get_flow_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_action_id_for_flow_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Action - # Get a flow action from a flow with the given flow action ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` - # @param id [String] + # alias of `get_action_id_for_flow_message_with_http_info` + alias get_flow_message_relationships_action_with_http_info get_action_id_for_flow_message_with_http_info + + # Get Action IDs for Flow + # Get all [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for flow actions associated with the given flow ID. Flow action relationships can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow action relationships per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # @param id [String] ID of the Flow to update. Ex: XVTP5Q # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 100. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_flow_action(id, opts = {}) - data, _status_code, _headers = get_flow_action_with_http_info(id, opts) + def get_action_ids_for_flow(id, opts = {}) + data, _status_code, _headers = get_action_ids_for_flow_with_http_info(id, opts) data end - # Get Flow Action - # Get a flow action from a flow with the given flow action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` - # @param id [String] + # alias of `get_action_ids_for_flow` + alias get_flow_relationships_flow_actions get_action_ids_for_flow + + # Get Action IDs for Flow + # Get all [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for flow actions associated with the given flow ID. Flow action relationships can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow action relationships per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # @param id [String] ID of the Flow to update. Ex: XVTP5Q # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 100. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_action_with_http_info(id, opts = {}) + def get_action_ids_for_flow_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_action_ids_for_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action" - end - allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] - if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_action_ids_for_flow" end - allowable_values = ["name", "channel", "content", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_action_ids_for_flow, must be smaller than or equal to 100.' end - allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] - if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_action_ids_for_flow, must be greater than or equal to 1.' end - allowable_values = ["flow", "flow-messages"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + + allowable_values = ["created", "-created", "id", "-id", "status", "-status", "updated", "-updated"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-actions/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}/relationships/flow-actions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? - query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil? - query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -254,7 +228,7 @@ def get_flow_action_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_action", + :operation => :"FlowsApi.get_action_ids_for_flow", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -265,53 +239,83 @@ def get_flow_action_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_action_ids_for_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow For Flow Action - # Get the flow associated with the given action ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_action_ids_for_flow_with_http_info` + alias get_flow_relationships_flow_actions_with_http_info get_action_ids_for_flow_with_http_info + + # Get Actions for Flow + # Get all flow actions associated with the given flow ID. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_flow_action_flow(id, opts = {}) - data, _status_code, _headers = get_flow_action_flow_with_http_info(id, opts) + def get_actions_for_flow(id, opts = {}) + data, _status_code, _headers = get_actions_for_flow_with_http_info(id, opts) data end - # Get Flow For Flow Action - # Get the flow associated with the given action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_actions_for_flow` + alias get_flow_flow_actions get_actions_for_flow + + # Get Actions for Flow + # Get all flow actions associated with the given flow ID. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_action_flow_with_http_info(id, opts = {}) + def get_actions_for_flow_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_flow ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_actions_for_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action_flow" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_actions_for_flow" end - allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] - if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "tracking_options.add_utm", "tracking_options.utm_params", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] + if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_actions_for_flow, must be smaller than or equal to 50.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_actions_for_flow, must be greater than or equal to 1.' + end + + allowable_values = ["action_type", "-action_type", "created", "-created", "id", "-id", "status", "-status", "updated", "-updated"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-actions/{id}/flow/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}/flow-actions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? + query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -326,7 +330,7 @@ def get_flow_action_flow_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_action_flow", + :operation => :"FlowsApi.get_actions_for_flow", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -337,74 +341,77 @@ def get_flow_action_flow_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_action_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_actions_for_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Action Messages - # Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: ascending: `id`, `name`, `created`, `updated` descending: `-id`, `-name`, `-created`, `-updated` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_actions_for_flow_with_http_info` + alias get_flow_flow_actions_with_http_info get_actions_for_flow_with_http_info + + # Get Flow + # Get a flow with the given flow ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 100. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_flow_action_messages(id, opts = {}) - data, _status_code, _headers = get_flow_action_messages_with_http_info(id, opts) + def get_flow(id, opts = {}) + data, _status_code, _headers = get_flow_with_http_info(id, opts) data end - # Get Flow Action Messages - # Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: ascending: `id`, `name`, `created`, `updated` descending: `-id`, `-name`, `-created`, `-updated` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # Get Flow + # Get a flow with the given flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 100. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_action_messages_with_http_info(id, opts = {}) + def get_flow_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_messages ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action_messages" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow" end - allowable_values = ["name", "channel", "content", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}" + allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "tracking_options.add_utm", "tracking_options.utm_params", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] + if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_action_messages, must be smaller than or equal to 100.' + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_action_messages, must be greater than or equal to 1.' + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end - - allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["flow-actions", "tags"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-actions/{id}/flow-messages/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -419,7 +426,7 @@ def get_flow_action_messages_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_action_messages", + :operation => :"FlowsApi.get_flow", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -430,46 +437,74 @@ def get_flow_action_messages_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_action_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Action Relationships Flow - # Get the flow associated with the given action ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # Get Flow Action + # Get a flow action from a flow with the given flow action ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_flow_action_relationships_flow(id, opts = {}) - data, _status_code, _headers = get_flow_action_relationships_flow_with_http_info(id, opts) + def get_flow_action(id, opts = {}) + data, _status_code, _headers = get_flow_action_with_http_info(id, opts) data end - # Get Flow Action Relationships Flow - # Get the flow associated with the given action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # Get Flow Action + # Get a flow action from a flow with the given flow action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_action_relationships_flow_with_http_info(id, opts = {}) + def get_flow_action_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_relationships_flow ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action_relationships_flow" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action" + end + allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "tracking_options.add_utm", "tracking_options.utm_params", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] + if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" + end + allowable_values = ["name", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "content.title", "content.sound", "content.badge", "content.dynamic_image", "content.ios_link", "content.android_link", "content.on_open", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}" + end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end + allowable_values = ["flow", "flow-messages"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-actions/{id}/relationships/flow/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-actions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? + query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -484,7 +519,7 @@ def get_flow_action_relationships_flow_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_action_relationships_flow", + :operation => :"FlowsApi.get_flow_action", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -495,70 +530,53 @@ def get_flow_action_relationships_flow_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_action_relationships_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_flow_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Action Relationships Messages - # Get all relationships for flow messages associated with the given flow action ID. Returns a maximum of 50 flow message relationships per request, which can be paginated with cursor-based pagination.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # Get Flow For Flow Action + # Get the flow associated with the given action ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_flow_action_relationships_messages(id, opts = {}) - data, _status_code, _headers = get_flow_action_relationships_messages_with_http_info(id, opts) + def get_flow_action_flow(id, opts = {}) + data, _status_code, _headers = get_flow_action_flow_with_http_info(id, opts) data end - # Get Flow Action Relationships Messages - # Get all relationships for flow messages associated with the given flow action ID. Returns a maximum of 50 flow message relationships per request, which can be paginated with cursor-based pagination.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # Get Flow For Flow Action + # Get the flow associated with the given action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_action_relationships_messages_with_http_info(id, opts = {}) + def get_flow_action_flow_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_relationships_messages ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action_relationships_messages" - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_action_relationships_messages, must be smaller than or equal to 50.' - end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_action_relationships_messages, must be greater than or equal to 1.' + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action_flow" end - - allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-actions/{id}/relationships/flow-messages/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-actions/{id}/flow'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -573,7 +591,7 @@ def get_flow_action_relationships_messages_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_action_relationships_messages", + :operation => :"FlowsApi.get_flow_action_flow", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -584,77 +602,49 @@ def get_flow_action_relationships_messages_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_action_relationships_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_flow_action_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Flow Actions - # Get all flow actions associated with the given flow ID. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # Get Flow ID for Flow Action + # Get the flow associated with the given action ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Hash] - def get_flow_flow_actions(id, opts = {}) - data, _status_code, _headers = get_flow_flow_actions_with_http_info(id, opts) + def get_flow_id_for_flow_action(id, opts = {}) + data, _status_code, _headers = get_flow_id_for_flow_action_with_http_info(id, opts) data end - # Get Flow Flow Actions - # Get all flow actions associated with the given flow ID. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_flow_id_for_flow_action` + alias get_flow_action_relationships_flow get_flow_id_for_flow_action + + # Get Flow ID for Flow Action + # Get the flow associated with the given action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_flow_actions_with_http_info(id, opts = {}) + def get_flow_id_for_flow_action_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_flow_actions ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_id_for_flow_action ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_flow_actions" - end - allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] - if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_flow_actions, must be smaller than or equal to 50.' - end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_flow_actions, must be greater than or equal to 1.' - end - - allowable_values = ["action_type", "-action_type", "created", "-created", "id", "-id", "status", "-status", "updated", "-updated"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_id_for_flow_action" end # resource path - local_var_path = '/api/flows/{id}/flow-actions/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-actions/{id}/relationships/flow'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -669,7 +659,7 @@ def get_flow_flow_actions_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_flow_actions", + :operation => :"FlowsApi.get_flow_id_for_flow_action", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -680,19 +670,22 @@ def get_flow_flow_actions_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_flow_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_flow_id_for_flow_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `get_flow_id_for_flow_action_with_http_info` + alias get_flow_action_relationships_flow_with_http_info get_flow_id_for_flow_action_with_http_info + # Get Flow Message # Get the flow message of a flow with the given message ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_flow_message(id, opts = {}) data, _status_code, _headers = get_flow_message_with_http_info(id, opts) @@ -703,10 +696,10 @@ def get_flow_message(id, opts = {}) # Get the flow message of a flow with the given message ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_flow_message_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -716,11 +709,11 @@ def get_flow_message_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message" end - allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] + allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "tracking_options.add_utm", "tracking_options.utm_params", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" end - allowable_values = ["name", "channel", "content", "created", "updated"] + allowable_values = ["name", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "content.title", "content.sound", "content.badge", "content.dynamic_image", "content.ios_link", "content.android_link", "content.on_open", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}" end @@ -733,7 +726,7 @@ def get_flow_message_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-messages/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-messages/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -745,9 +738,9 @@ def get_flow_message_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -782,7 +775,7 @@ def get_flow_message_with_http_info(id, opts = {}) # Get the flow action for a flow message with the given message ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_flow_message_action(id, opts = {}) data, _status_code, _headers = get_flow_message_action_with_http_info(id, opts) @@ -793,7 +786,7 @@ def get_flow_message_action(id, opts = {}) # Get the flow action for a flow message with the given message ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_flow_message_action_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -803,12 +796,12 @@ def get_flow_message_action_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message_action" end - allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] + allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "tracking_options.add_utm", "tracking_options.utm_params", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-messages/{id}/flow-action/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-messages/{id}/flow-action'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -817,9 +810,9 @@ def get_flow_message_action_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -850,41 +843,48 @@ def get_flow_message_action_with_http_info(id, opts = {}) return data, status_code, headers end - # Get Flow Message Relationships Action - # Get the [relationship](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # Get Flow Tags + # Return all tags associated with the given flow ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `tags:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_flow_message_relationships_action(id, opts = {}) - data, _status_code, _headers = get_flow_message_relationships_action_with_http_info(id, opts) + def get_flow_tags(id, opts = {}) + data, _status_code, _headers = get_flow_tags_with_http_info(id, opts) data end - # Get Flow Message Relationships Action - # Get the [relationship](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # Get Flow Tags + # Return all tags associated with the given flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `tags:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_message_relationships_action_with_http_info(id, opts = {}) + def get_flow_tags_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_message_relationships_action ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_tags ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message_relationships_action" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_tags" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-messages/{id}/relationships/flow-action/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -899,7 +899,7 @@ def get_flow_message_relationships_action_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_message_relationships_action", + :operation => :"FlowsApi.get_flow_tags", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -910,46 +910,92 @@ def get_flow_message_relationships_action_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_message_relationships_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_flow_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Message Relationships Template - # Returns the ID of the related template

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `templates:read` - # @param id [String] + # Get Flows + # Get all flows in an account. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_flow_message_relationships_template(id, opts = {}) - data, _status_code, _headers = get_flow_message_relationships_template_with_http_info(id, opts) + def get_flows(opts = {}) + data, _status_code, _headers = get_flows_with_http_info(opts) data end - # Get Flow Message Relationships Template - # Returns the ID of the related template<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `templates:read` - # @param id [String] + # Get Flows + # Get all flows in an account. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_message_relationships_template_with_http_info(id, opts = {}) + def get_flows_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_message_relationships_template ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_flows ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message_relationships_template" + allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "tracking_options.add_utm", "tracking_options.utm_params", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] + if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" + end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + end + allowable_values = ["flow-actions", "tags"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flows, must be smaller than or equal to 50.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flows, must be greater than or equal to 1.' + end + + allowable_values = ["created", "-created", "id", "-id", "name", "-name", "status", "-status", "trigger_type", "-trigger_type", "updated", "-updated"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-messages/{id}/relationships/template/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -964,7 +1010,7 @@ def get_flow_message_relationships_template_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_message_relationships_template", + :operation => :"FlowsApi.get_flows", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -975,53 +1021,73 @@ def get_flow_message_relationships_template_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_message_relationships_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Message Template - # Return the related template

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `templates:read` + # Get Message IDs for Flow Action + # Get all relationships for flow messages associated with the given flow action ID. Returns a maximum of 50 flow message relationships per request, which can be paginated with cursor-based pagination.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_flow_message_template(id, opts = {}) - data, _status_code, _headers = get_flow_message_template_with_http_info(id, opts) + def get_message_ids_for_flow_action(id, opts = {}) + data, _status_code, _headers = get_message_ids_for_flow_action_with_http_info(id, opts) data end - # Get Flow Message Template - # Return the related template<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `templates:read` + # alias of `get_message_ids_for_flow_action` + alias get_flow_action_relationships_messages get_message_ids_for_flow_action + + # Get Message IDs for Flow Action + # Get all relationships for flow messages associated with the given flow action ID. Returns a maximum of 50 flow message relationships per request, which can be paginated with cursor-based pagination.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_message_template_with_http_info(id, opts = {}) + def get_message_ids_for_flow_action_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_message_template ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_message_ids_for_flow_action ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message_template" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_message_ids_for_flow_action" end - allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] - if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_message_ids_for_flow_action, must be smaller than or equal to 50.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_message_ids_for_flow_action, must be greater than or equal to 1.' + end + + allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/flow-messages/{id}/template/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-actions/{id}/relationships/flow-messages'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1036,7 +1102,7 @@ def get_flow_message_template_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_message_template", + :operation => :"FlowsApi.get_message_ids_for_flow_action", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1047,57 +1113,70 @@ def get_flow_message_template_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_message_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_message_ids_for_flow_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Relationships Flow Actions - # Get all [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for flow actions associated with the given flow ID. Flow action relationships can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow action relationships per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_message_ids_for_flow_action_with_http_info` + alias get_flow_action_relationships_messages_with_http_info get_message_ids_for_flow_action_with_http_info + + # Get Messages for Flow Action + # Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: ascending: `id`, `name`, `created`, `updated` descending: `-id`, `-name`, `-created`, `-updated` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 100. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_flow_relationships_flow_actions(id, opts = {}) - data, _status_code, _headers = get_flow_relationships_flow_actions_with_http_info(id, opts) + def get_messages_for_flow_action(id, opts = {}) + data, _status_code, _headers = get_messages_for_flow_action_with_http_info(id, opts) data end - # Get Flow Relationships Flow Actions - # Get all [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for flow actions associated with the given flow ID. Flow action relationships can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow action relationships per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_messages_for_flow_action` + alias get_flow_action_messages get_messages_for_flow_action + + # Get Messages for Flow Action + # Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: ascending: `id`, `name`, `created`, `updated` descending: `-id`, `-name`, `-created`, `-updated` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [Array] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 100. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_relationships_flow_actions_with_http_info(id, opts = {}) + def get_messages_for_flow_action_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_relationships_flow_actions ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_messages_for_flow_action ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_relationships_flow_actions" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_messages_for_flow_action" + end + allowable_values = ["name", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.reply_to_email", "content.cc_email", "content.bcc_email", "content.body", "content.media_url", "content.title", "content.sound", "content.badge", "content.dynamic_image", "content.ios_link", "content.android_link", "content.on_open", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_relationships_flow_actions, must be smaller than or equal to 100.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_messages_for_flow_action, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flow_relationships_flow_actions, must be greater than or equal to 1.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_messages_for_flow_action, must be greater than or equal to 1.' end - allowable_values = ["created", "-created", "id", "-id", "status", "-status", "updated", "-updated"] + allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/flows/{id}/relationships/flow-actions/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-actions/{id}/flow-messages'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? @@ -1105,9 +1184,9 @@ def get_flow_relationships_flow_actions_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1122,7 +1201,7 @@ def get_flow_relationships_flow_actions_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_relationships_flow_actions", + :operation => :"FlowsApi.get_messages_for_flow_action", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1133,36 +1212,42 @@ def get_flow_relationships_flow_actions_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_relationships_flow_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_messages_for_flow_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Relationships Tags + # alias of `get_messages_for_flow_action_with_http_info` + alias get_flow_action_messages_with_http_info get_messages_for_flow_action_with_http_info + + # Get Tag IDs for Flow # Return the tag IDs of all tags associated with the given flow.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `tags:read` # @param id [String] # @param [Hash] opts the optional parameters # @return [Hash] - def get_flow_relationships_tags(id, opts = {}) - data, _status_code, _headers = get_flow_relationships_tags_with_http_info(id, opts) + def get_tag_ids_for_flow(id, opts = {}) + data, _status_code, _headers = get_tag_ids_for_flow_with_http_info(id, opts) data end - # Get Flow Relationships Tags + # alias of `get_tag_ids_for_flow` + alias get_flow_relationships_tags get_tag_ids_for_flow + + # Get Tag IDs for Flow # Return the tag IDs of all tags associated with the given flow.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `tags:read` # @param id [String] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_relationships_tags_with_http_info(id, opts = {}) + def get_tag_ids_for_flow_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_relationships_tags ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_tag_ids_for_flow ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_relationships_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_tag_ids_for_flow" end # resource path - local_var_path = '/api/flows/{id}/relationships/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}/relationships/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1170,9 +1255,9 @@ def get_flow_relationships_tags_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1187,7 +1272,7 @@ def get_flow_relationships_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_relationships_tags", + :operation => :"FlowsApi.get_tag_ids_for_flow", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1198,53 +1283,59 @@ def get_flow_relationships_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_relationships_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_tag_ids_for_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flow Tags - # Return all tags associated with the given flow ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `tags:read` + # alias of `get_tag_ids_for_flow_with_http_info` + alias get_flow_relationships_tags_with_http_info get_tag_ids_for_flow_with_http_info + + # Get Template for Flow Message + # Return the related template

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `templates:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_flow_tags(id, opts = {}) - data, _status_code, _headers = get_flow_tags_with_http_info(id, opts) + def get_template_for_flow_message(id, opts = {}) + data, _status_code, _headers = get_template_for_flow_message_with_http_info(id, opts) data end - # Get Flow Tags - # Return all tags associated with the given flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `tags:read` + # alias of `get_template_for_flow_message` + alias get_flow_message_template get_template_for_flow_message + + # Get Template for Flow Message + # Return the related template<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `templates:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flow_tags_with_http_info(id, opts = {}) + def get_template_for_flow_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_tags ...' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_template_for_flow_message ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_template_for_flow_message" end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + allowable_values = ["name", "editor_type", "html", "text", "created", "updated"] + if @api_client.config.client_side_validation && opts[:'fields_template'] && !opts[:'fields_template'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/flows/{id}/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flow-messages/{id}/template'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'fields[template]'] = @api_client.build_collection_param(opts[:'fields_template'], :csv) if !opts[:'fields_template'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1259,7 +1350,7 @@ def get_flow_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flow_tags", + :operation => :"FlowsApi.get_template_for_flow_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1270,92 +1361,52 @@ def get_flow_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flow_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_template_for_flow_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Flows - # Get all flows in an account. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_template_for_flow_message_with_http_info` + alias get_flow_message_template_with_http_info get_template_for_flow_message_with_http_info + + # Get Template ID for Flow Message + # Returns the ID of the related template

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `templates:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Hash] - def get_flows(opts = {}) - data, _status_code, _headers = get_flows_with_http_info(opts) + def get_template_id_for_flow_message(id, opts = {}) + data, _status_code, _headers = get_template_id_for_flow_message_with_http_info(id, opts) data end - # Get Flows - # Get all flows in an account. Returns a maximum of 50 flows per request, which can be paginated with cursor-based pagination.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` + # alias of `get_template_id_for_flow_message` + alias get_flow_message_relationships_template get_template_id_for_flow_message + + # Get Template ID for Flow Message + # Returns the ID of the related template<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `templates:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 50. Min: 1. Max: 50. (default to 50) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flows_with_http_info(opts = {}) + def get_template_id_for_flow_message_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FlowsApi.get_flows ...' - end - allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"] - if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}" - end - allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] - if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" - end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" - end - allowable_values = ["flow-actions", "tags"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flows, must be smaller than or equal to 50.' - end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FlowsApi.get_flows, must be greater than or equal to 1.' + @api_client.config.logger.debug 'Calling API: FlowsApi.get_template_id_for_flow_message ...' end - - allowable_values = ["created", "-created", "id", "-id", "name", "-name", "status", "-status", "trigger_type", "-trigger_type", "updated", "-updated"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_template_id_for_flow_message" end # resource path - local_var_path = '/api/flows/' + local_var_path = '/api/flow-messages/{id}/relationships/template'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil? - query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1370,7 +1421,7 @@ def get_flows_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"FlowsApi.get_flows", + :operation => :"FlowsApi.get_template_id_for_flow_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1381,11 +1432,14 @@ def get_flows_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FlowsApi#get_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FlowsApi#get_template_id_for_flow_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `get_template_id_for_flow_message_with_http_info` + alias get_flow_message_relationships_template_with_http_info get_template_id_for_flow_message_with_http_info + # Update Flow Status # Update the status of a flow with the given flow ID, and all actions in that flow.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:write` # @param id [String] ID of the Flow to update. Ex: XVTP5Q @@ -1416,7 +1470,7 @@ def update_flow_with_http_info(id, flow_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'flow_update_query' when calling FlowsApi.update_flow" end # resource path - local_var_path = '/api/flows/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/flows/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1424,11 +1478,11 @@ def update_flow_with_http_info(id, flow_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/forms_api.rb b/lib/klaviyo-api-sdk/api/forms_api.rb index 7ecb2f2..93cf5ed 100644 --- a/lib/klaviyo-api-sdk/api/forms_api.rb +++ b/lib/klaviyo-api-sdk/api/forms_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -23,9 +23,9 @@ def initialize(api_client = ApiClient.default) # Get the form with the given ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` # @param id [String] The ID of the form # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_form(id, opts = {}) data, _status_code, _headers = get_form_with_http_info(id, opts) @@ -36,9 +36,9 @@ def get_form(id, opts = {}) # Get the form with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` # @param id [String] The ID of the form # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_form_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -61,7 +61,7 @@ def get_form_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/forms/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/forms/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -72,9 +72,9 @@ def get_form_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -107,9 +107,9 @@ def get_form_with_http_info(id, opts = {}) # Get Form for Form Version # Get the form associated with the given form version.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form version # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_form_for_form_version(id, opts = {}) data, _status_code, _headers = get_form_for_form_version_with_http_info(id, opts) @@ -121,9 +121,9 @@ def get_form_for_form_version(id, opts = {}) # Get Form for Form Version # Get the form associated with the given form version.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form version # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_form_for_form_version_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -138,7 +138,7 @@ def get_form_for_form_version_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_form\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/form-versions/{id}/form/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/form-versions/{id}/form'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -147,9 +147,9 @@ def get_form_for_form_version_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -185,7 +185,7 @@ def get_form_for_form_version_with_http_info(id, opts = {}) # Get Form ID for Form Version # Get the ID of the form associated with the given form version.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form version # @param [Hash] opts the optional parameters # @return [Hash] def get_form_id_for_form_version(id, opts = {}) @@ -198,7 +198,7 @@ def get_form_id_for_form_version(id, opts = {}) # Get Form ID for Form Version # Get the ID of the form associated with the given form version.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form version # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_form_id_for_form_version_with_http_info(id, opts = {}) @@ -210,7 +210,7 @@ def get_form_id_for_form_version_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling FormsApi.get_form_id_for_form_version" end # resource path - local_var_path = '/api/form-versions/{id}/relationships/form/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/form-versions/{id}/relationships/form'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -218,9 +218,9 @@ def get_form_id_for_form_version_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -258,7 +258,7 @@ def get_form_id_for_form_version_with_http_info(id, opts = {}) # Get the form version with the given ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` # @param id [String] The ID of the form version # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_form_version(id, opts = {}) data, _status_code, _headers = get_form_version_with_http_info(id, opts) @@ -269,7 +269,7 @@ def get_form_version(id, opts = {}) # Get the form version with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` # @param id [String] The ID of the form version # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_form_version_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -284,7 +284,7 @@ def get_form_version_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_form_version\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/form-versions/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/form-versions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -293,9 +293,9 @@ def get_form_version_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -329,11 +329,11 @@ def get_form_version_with_http_info(id, opts = {}) # Get Forms # Get all forms in an account.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_forms(opts = {}) data, _status_code, _headers = get_forms_with_http_info(opts) @@ -343,11 +343,11 @@ def get_forms(opts = {}) # Get Forms # Get all forms in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_form For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`ab_test`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_forms_with_http_info(opts = {}) if @api_client.config.debugging @@ -370,7 +370,7 @@ def get_forms_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/forms/' + local_var_path = '/api/forms' # query parameters query_params = opts[:query_params] || {} @@ -383,9 +383,9 @@ def get_forms_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -418,7 +418,7 @@ def get_forms_with_http_info(opts = {}) # Get Version IDs for Form # Get the IDs of the form versions for the given form.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form # @param [Hash] opts the optional parameters # @return [Hash] def get_version_ids_for_form(id, opts = {}) @@ -431,7 +431,7 @@ def get_version_ids_for_form(id, opts = {}) # Get Version IDs for Form # Get the IDs of the form versions for the given form.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_version_ids_for_form_with_http_info(id, opts = {}) @@ -443,7 +443,7 @@ def get_version_ids_for_form_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling FormsApi.get_version_ids_for_form" end # resource path - local_var_path = '/api/forms/{id}/relationships/form-versions/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/forms/{id}/relationships/form-versions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -451,9 +451,9 @@ def get_version_ids_for_form_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -489,13 +489,13 @@ def get_version_ids_for_form_with_http_info(id, opts = {}) # Get Versions for Form # Get the form versions for the given form.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_versions_for_form(id, opts = {}) data, _status_code, _headers = get_versions_for_form_with_http_info(id, opts) @@ -507,22 +507,18 @@ def get_versions_for_form(id, opts = {}) # Get Versions for Form # Get the form versions for the given form.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `forms:read` - # @param id [String] + # @param id [String] The ID of the form # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_form_version For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_versions_for_form_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FormsApi.get_versions_for_form ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FormsApi.get_versions_for_form" - end allowable_values = ["form_type", "ab_test", "ab_test.variation_name", "status", "created_at", "updated_at"] if @api_client.config.client_side_validation && opts[:'fields_form_version'] && !opts[:'fields_form_version'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_form_version\", must include one of #{allowable_values}" @@ -540,7 +536,7 @@ def get_versions_for_form_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/forms/{id}/form-versions/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/forms/{id}/form-versions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -553,9 +549,9 @@ def get_versions_for_form_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} diff --git a/lib/klaviyo-api-sdk/api/images_api.rb b/lib/klaviyo-api-sdk/api/images_api.rb index f7d109f..a249b34 100644 --- a/lib/klaviyo-api-sdk/api/images_api.rb +++ b/lib/klaviyo-api-sdk/api/images_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -23,7 +23,7 @@ def initialize(api_client = ApiClient.default) # Get the image with the given image ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `images:read` # @param id [String] The ID of the image # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_image(id, opts = {}) data, _status_code, _headers = get_image_with_http_info(id, opts) @@ -34,7 +34,7 @@ def get_image(id, opts = {}) # Get the image with the given image ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `images:read` # @param id [String] The ID of the image # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_image_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -49,7 +49,7 @@ def get_image_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_image\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/images/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/images/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -58,9 +58,9 @@ def get_image_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -94,11 +94,11 @@ def get_image_with_http_info(id, opts = {}) # Get Images # Get all images in an account.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `images:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_images(opts = {}) data, _status_code, _headers = get_images_with_http_info(opts) @@ -108,11 +108,11 @@ def get_images(opts = {}) # Get Images # Get all images in an account.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `images:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_image For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`format`: `any`, `equals`<br>`name`: `any`, `contains`, `ends-with`, `equals`, `starts-with`<br>`size`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`hidden`: `any`, `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_images_with_http_info(opts = {}) if @api_client.config.debugging @@ -135,7 +135,7 @@ def get_images_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/images/' + local_var_path = '/api/images' # query parameters query_params = opts[:query_params] || {} @@ -148,9 +148,9 @@ def get_images_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -211,7 +211,7 @@ def update_image_with_http_info(id, image_partial_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'image_partial_update_query' when calling ImagesApi.update_image" end # resource path - local_var_path = '/api/images/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/images/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -219,11 +219,11 @@ def update_image_with_http_info(id, image_partial_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -288,7 +288,7 @@ def upload_image_from_file_with_http_info(file, opts = {}) fail ArgumentError, "Missing the required parameter 'file' when calling ImagesApi.upload_image_from_file" end # resource path - local_var_path = '/api/image-upload/' + local_var_path = '/api/image-upload' # query parameters query_params = opts[:query_params] || {} @@ -296,9 +296,9 @@ def upload_image_from_file_with_http_info(file, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? @@ -367,7 +367,7 @@ def upload_image_from_url_with_http_info(image_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'image_create_query' when calling ImagesApi.upload_image_from_url" end # resource path - local_var_path = '/api/images/' + local_var_path = '/api/images' # query parameters query_params = opts[:query_params] || {} @@ -375,11 +375,11 @@ def upload_image_from_url_with_http_info(image_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/lists_api.rb b/lib/klaviyo-api-sdk/api/lists_api.rb index c0be32c..5f59832 100644 --- a/lib/klaviyo-api-sdk/api/lists_api.rb +++ b/lib/klaviyo-api-sdk/api/lists_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Create List - # Create a new list.

*Rate limits*:
Burst: `10/s`
Steady: `150/m`
Daily: `100/d` **Scopes:** `lists:write` + # Create a new list.

*Rate limits*:
Burst: `10/s`
Steady: `150/m`
Daily: `150/d` **Scopes:** `lists:write` # @param list_create_query [ListCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] @@ -30,7 +30,7 @@ def create_list(list_create_query, opts = {}) end # Create List - # Create a new list.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m`<br>Daily: `100/d` **Scopes:** `lists:write` + # Create a new list.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m`<br>Daily: `150/d` **Scopes:** `lists:write` # @param list_create_query [ListCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers @@ -43,7 +43,7 @@ def create_list_with_http_info(list_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'list_create_query' when calling ListsApi.create_list" end # resource path - local_var_path = '/api/lists/' + local_var_path = '/api/lists' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +51,11 @@ def create_list_with_http_info(list_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -122,7 +122,7 @@ def create_list_relationships_with_http_info(id, list_members_add_query, opts = fail ArgumentError, "Missing the required parameter 'list_members_add_query' when calling ListsApi.create_list_relationships" end # resource path - local_var_path = '/api/lists/{id}/relationships/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}/relationships/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -130,11 +130,11 @@ def create_list_relationships_with_http_info(id, list_members_add_query, opts = # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -195,7 +195,7 @@ def delete_list_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.delete_list" end # resource path - local_var_path = '/api/lists/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -203,9 +203,9 @@ def delete_list_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -269,7 +269,7 @@ def delete_list_relationships_with_http_info(id, list_members_delete_query, opts fail ArgumentError, "Missing the required parameter 'list_members_delete_query' when calling ListsApi.delete_list_relationships" end # resource path - local_var_path = '/api/lists/{id}/relationships/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}/relationships/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -277,11 +277,11 @@ def delete_list_relationships_with_http_info(id, list_members_delete_query, opts # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -319,13 +319,14 @@ def delete_list_relationships_with_http_info(id, list_members_delete_query, opts alias delete_list_relationships_profiles_with_http_info delete_list_relationships_with_http_info # Get List - # Get a list with the given list ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[list]=profile_count` parameter in your API request:
Burst: `1/s`
Steady: `15/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` + # Get a list with the given list ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[list]=profile_count` parameter in your API request:
Burst: `1/s`
Steady: `15/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_list(id, opts = {}) data, _status_code, _headers = get_list_with_http_info(id, opts) @@ -333,13 +334,14 @@ def get_list(id, opts = {}) end # Get List - # Get a list with the given list ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[list]=profile_count` parameter in your API request:<br>Burst: `1/s`<br>Steady: `15/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` + # Get a list with the given list ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[list]=profile_count` parameter in your API request:<br>Burst: `1/s`<br>Steady: `15/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_list Request additional fields not included by default in the response. Supported values: 'profile_count' - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_list_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -353,6 +355,10 @@ def get_list_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && opts[:'additional_fields_list'] && !opts[:'additional_fields_list'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"additional_fields_list\", must include one of #{allowable_values}" end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end allowable_values = ["name", "created", "updated", "opt_in_process", "profile_count"] if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" @@ -361,16 +367,17 @@ def get_list_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end - allowable_values = ["tags"] + allowable_values = ["flow-triggers", "tags"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/lists/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'additional-fields[list]'] = @api_client.build_collection_param(opts[:'additional_fields_list'], :csv) if !opts[:'additional_fields_list'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? @@ -378,9 +385,9 @@ def get_list_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -411,79 +418,48 @@ def get_list_with_http_info(id, opts = {}) return data, status_code, headers end - # Get List Profiles - # Get all profiles within a list with the given list ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, `push_token`, and `joined_group_at` fields. Profiles can be sorted by the following fields, in ascending and descending order: `joined_group_at`

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:
Burst: `10/s`
Steady: `150/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` `profiles:read` - # @param id [String] + # Get List Flow Triggers + # Get all flows where the given lsit ID is being used as the trigger.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `lists:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_list_profiles(id, opts = {}) - data, _status_code, _headers = get_list_profiles_with_http_info(id, opts) + def get_list_flow_triggers(id, opts = {}) + data, _status_code, _headers = get_list_flow_triggers_with_http_info(id, opts) data end - # Get List Profiles - # Get all profiles within a list with the given list ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, `push_token`, and `joined_group_at` fields. Profiles can be sorted by the following fields, in ascending and descending order: `joined_group_at`<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:<br>Burst: `10/s`<br>Steady: `150/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` `profiles:read` - # @param id [String] + # Get List Flow Triggers + # Get all flows where the given lsit ID is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `lists:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_list_profiles_with_http_info(id, opts = {}) + def get_list_flow_triggers_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ListsApi.get_list_profiles ...' + @api_client.config.logger.debug 'Calling API: ListsApi.get_list_flow_triggers ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_list_profiles" - end - allowable_values = ["subscriptions", "predictive_analytics"] - if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" - end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "joined_group_at", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] - if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_list_profiles, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_list_profiles, must be greater than or equal to 1.' + fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_list_flow_triggers" end - - allowable_values = ["joined_group_at", "-joined_group_at"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/lists/{id}/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil? - query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -498,7 +474,7 @@ def get_list_profiles_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ListsApi.get_list_profiles", + :operation => :"ListsApi.get_list_flow_triggers", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -509,48 +485,60 @@ def get_list_profiles_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ListsApi#get_list_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ListsApi#get_list_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get List Relationships Profiles - # Get profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a list with the given list ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:read` `profiles:read` - # @param id [String] + # Get List Profiles + # Get all profiles within a list with the given list ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, `push_token`, and `joined_group_at` fields. Profiles can be sorted by the following fields, in ascending and descending order: `joined_group_at`

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:
Burst: `10/s`
Steady: `150/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` `profiles:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_list_relationships_profiles(id, opts = {}) - data, _status_code, _headers = get_list_relationships_profiles_with_http_info(id, opts) + def get_list_profiles(id, opts = {}) + data, _status_code, _headers = get_list_profiles_with_http_info(id, opts) data end - # Get List Relationships Profiles - # Get profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a list with the given list ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:read` `profiles:read` - # @param id [String] + # Get List Profiles + # Get all profiles within a list with the given list ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, `push_token`, and `joined_group_at` fields. Profiles can be sorted by the following fields, in ascending and descending order: `joined_group_at`<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:<br>Burst: `10/s`<br>Steady: `150/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `lists:read` `profiles:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_list_relationships_profiles_with_http_info(id, opts = {}) + def get_list_profiles_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ListsApi.get_list_relationships_profiles ...' + @api_client.config.logger.debug 'Calling API: ListsApi.get_list_profiles ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_list_relationships_profiles" + fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_list_profiles" end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_list_relationships_profiles, must be smaller than or equal to 1000.' + allowable_values = ["subscriptions", "predictive_analytics"] + if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" + end + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "joined_group_at", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] + if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_list_profiles, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_list_relationships_profiles, must be greater than or equal to 1.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_list_profiles, must be greater than or equal to 1.' end allowable_values = ["joined_group_at", "-joined_group_at"] @@ -558,10 +546,12 @@ def get_list_relationships_profiles_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/lists/{id}/relationships/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil? + query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? @@ -570,9 +560,9 @@ def get_list_relationships_profiles_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -587,7 +577,7 @@ def get_list_relationships_profiles_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ListsApi.get_list_relationships_profiles", + :operation => :"ListsApi.get_list_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -598,36 +588,36 @@ def get_list_relationships_profiles_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ListsApi#get_list_relationships_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ListsApi#get_list_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get List Relationships Tags - # Returns the tag IDs of all tags associated with the given list.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `tags:read` - # @param id [String] + # Get List Relationships Flow Triggers + # Get all flow [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) where the given list is being used as the trigger.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `lists:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters # @return [Hash] - def get_list_relationships_tags(id, opts = {}) - data, _status_code, _headers = get_list_relationships_tags_with_http_info(id, opts) + def get_list_relationships_flow_triggers(id, opts = {}) + data, _status_code, _headers = get_list_relationships_flow_triggers_with_http_info(id, opts) data end - # Get List Relationships Tags - # Returns the tag IDs of all tags associated with the given list.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `tags:read` - # @param id [String] + # Get List Relationships Flow Triggers + # Get all flow [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) where the given list is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `lists:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_list_relationships_tags_with_http_info(id, opts = {}) + def get_list_relationships_flow_triggers_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ListsApi.get_list_relationships_tags ...' + @api_client.config.logger.debug 'Calling API: ListsApi.get_list_relationships_flow_triggers ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_list_relationships_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_list_relationships_flow_triggers" end # resource path - local_var_path = '/api/lists/{id}/relationships/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -635,9 +625,9 @@ def get_list_relationships_tags_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -652,7 +642,7 @@ def get_list_relationships_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ListsApi.get_list_relationships_tags", + :operation => :"ListsApi.get_list_relationships_flow_triggers", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -663,16 +653,16 @@ def get_list_relationships_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ListsApi#get_list_relationships_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ListsApi#get_list_relationships_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get List Tags # Return all tags associated with the given list ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `tags:read` - # @param id [String] + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_list_tags(id, opts = {}) data, _status_code, _headers = get_list_tags_with_http_info(id, opts) @@ -681,9 +671,9 @@ def get_list_tags(id, opts = {}) # Get List Tags # Return all tags associated with the given list ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `tags:read` - # @param id [String] + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_list_tags_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -698,7 +688,7 @@ def get_list_tags_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/lists/{id}/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -707,9 +697,9 @@ def get_list_tags_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -743,12 +733,13 @@ def get_list_tags_with_http_info(id, opts = {}) # Get Lists # Get all lists in an account. Filter to request a subset of all lists. Lists can be filtered by `id`, `name`, `created`, and `updated` fields. Returns a maximum of 10 results per page.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_lists(opts = {}) data, _status_code, _headers = get_lists_with_http_info(opts) @@ -758,17 +749,22 @@ def get_lists(opts = {}) # Get Lists # Get all lists in an account. Filter to request a subset of all lists. Lists can be filtered by `id`, `name`, `created`, and `updated` fields. Returns a maximum of 10 results per page.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_lists_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.get_lists ...' end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end allowable_values = ["name", "created", "updated", "opt_in_process"] if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" @@ -777,7 +773,7 @@ def get_lists_with_http_info(opts = {}) if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end - allowable_values = ["tags"] + allowable_values = ["flow-triggers", "tags"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end @@ -786,10 +782,11 @@ def get_lists_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/lists/' + local_var_path = '/api/lists' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? @@ -800,9 +797,9 @@ def get_lists_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -833,6 +830,172 @@ def get_lists_with_http_info(opts = {}) return data, status_code, headers end + # Get Profile IDs for List + # Get profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a list with the given list ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:read` `profiles:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. + # @param [Hash] opts the optional parameters + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Hash] + def get_profile_ids_for_list(id, opts = {}) + data, _status_code, _headers = get_profile_ids_for_list_with_http_info(id, opts) + data + end + + # alias of `get_profile_ids_for_list` + alias get_list_relationships_profiles get_profile_ids_for_list + + # Get Profile IDs for List + # Get profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a list with the given list ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:read` `profiles:read` + # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. + # @param [Hash] opts the optional parameters + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_profile_ids_for_list_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ListsApi.get_profile_ids_for_list ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_profile_ids_for_list" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_profile_ids_for_list, must be smaller than or equal to 1000.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ListsApi.get_profile_ids_for_list, must be greater than or equal to 1.' + end + + allowable_values = ["joined_group_at", "-joined_group_at"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/lists/{id}/relationships/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ListsApi.get_profile_ids_for_list", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ListsApi#get_profile_ids_for_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_profile_ids_for_list_with_http_info` + alias get_list_relationships_profiles_with_http_info get_profile_ids_for_list_with_http_info + + # Get Tag IDs for List + # Returns the tag IDs of all tags associated with the given list.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `tags:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_tag_ids_for_list(id, opts = {}) + data, _status_code, _headers = get_tag_ids_for_list_with_http_info(id, opts) + data + end + + # alias of `get_tag_ids_for_list` + alias get_list_relationships_tags get_tag_ids_for_list + + # Get Tag IDs for List + # Returns the tag IDs of all tags associated with the given list.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `tags:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tag_ids_for_list_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ListsApi.get_tag_ids_for_list ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ListsApi.get_tag_ids_for_list" + end + # resource path + local_var_path = '/api/lists/{id}/relationships/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ListsApi.get_tag_ids_for_list", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ListsApi#get_tag_ids_for_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_tag_ids_for_list_with_http_info` + alias get_list_relationships_tags_with_http_info get_tag_ids_for_list_with_http_info + # Update List # Update the name of a list with the given list ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:write` # @param id [String] Primary key that uniquely identifies this list. Generated by Klaviyo. @@ -863,7 +1026,7 @@ def update_list_with_http_info(id, list_partial_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'list_partial_update_query' when calling ListsApi.update_list" end # resource path - local_var_path = '/api/lists/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/lists/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -871,11 +1034,11 @@ def update_list_with_http_info(id, list_partial_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/metrics_api.rb b/lib/klaviyo-api-sdk/api/metrics_api.rb index cb4b10b..7c5ce83 100644 --- a/lib/klaviyo-api-sdk/api/metrics_api.rb +++ b/lib/klaviyo-api-sdk/api/metrics_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -23,7 +23,9 @@ def initialize(api_client = ApiClient.default) # Get a metric with the given metric ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `metrics:read` # @param id [String] Metric ID # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_metric(id, opts = {}) data, _status_code, _headers = get_metric_with_http_info(id, opts) @@ -34,7 +36,9 @@ def get_metric(id, opts = {}) # Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read` # @param id [String] Metric ID # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_metric_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -44,23 +48,33 @@ def get_metric_with_http_info(id, opts = {}) if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric" end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end allowable_values = ["name", "created", "updated", "integration"] if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" end + allowable_values = ["flow-triggers"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end # resource path - local_var_path = '/api/metrics/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -91,12 +105,393 @@ def get_metric_with_http_info(id, opts = {}) return data, status_code, headers end + # Get Metric Flow Triggers + # Get all flows where the given metric is being used as the trigger.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `flows:read` `metrics:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_metric_flow_triggers(id, opts = {}) + data, _status_code, _headers = get_metric_flow_triggers_with_http_info(id, opts) + data + end + + # Get Metric Flow Triggers + # Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_metric_flow_triggers_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_flow_triggers ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_flow_triggers" + end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/metrics/{id}/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_metric_flow_triggers", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_metric_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Metric for Metric Property + # Get the metric for the given metric property ID.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric property + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_metric_for_metric_property(id, opts = {}) + data, _status_code, _headers = get_metric_for_metric_property_with_http_info(id, opts) + data + end + + # alias of `get_metric_for_metric_property` + alias get_metric_property_metric get_metric_for_metric_property + + # Get Metric for Metric Property + # Get the metric for the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric property + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_metric_for_metric_property_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_for_metric_property ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_for_metric_property" + end + allowable_values = ["name", "created", "updated", "integration"] + if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/metric-properties/{id}/metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_metric_for_metric_property", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_metric_for_metric_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_metric_for_metric_property_with_http_info` + alias get_metric_property_metric_with_http_info get_metric_for_metric_property_with_http_info + + # Get Metric ID for Metric Property + # Get the ID of the metric for the given metric property.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric property + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_metric_id_for_metric_property(id, opts = {}) + data, _status_code, _headers = get_metric_id_for_metric_property_with_http_info(id, opts) + data + end + + # alias of `get_metric_id_for_metric_property` + alias get_metric_property_relationships_metric get_metric_id_for_metric_property + + # Get Metric ID for Metric Property + # Get the ID of the metric for the given metric property.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric property + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_metric_id_for_metric_property_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_id_for_metric_property ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_id_for_metric_property" + end + # resource path + local_var_path = '/api/metric-properties/{id}/relationships/metric'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_metric_id_for_metric_property", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_metric_id_for_metric_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_metric_id_for_metric_property_with_http_info` + alias get_metric_property_relationships_metric_with_http_info get_metric_id_for_metric_property_with_http_info + + # Get Metric Property + # Get a metric property with the given metric property ID.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric property + # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' + # @option opts [Array] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @return [Hash] + def get_metric_property(id, opts = {}) + data, _status_code, _headers = get_metric_property_with_http_info(id, opts) + data + end + + # Get Metric Property + # Get a metric property with the given metric property ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric property + # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' + # @option opts [Array] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_metric_property_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_property ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_property" + end + allowable_values = ["sample_values"] + if @api_client.config.client_side_validation && opts[:'additional_fields_metric_property'] && !opts[:'additional_fields_metric_property'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"additional_fields_metric_property\", must include one of #{allowable_values}" + end + allowable_values = ["label", "property", "inferred_type", "sample_values"] + if @api_client.config.client_side_validation && opts[:'fields_metric_property'] && !opts[:'fields_metric_property'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_metric_property\", must include one of #{allowable_values}" + end + allowable_values = ["name", "created", "updated", "integration"] + if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" + end + allowable_values = ["metric"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/metric-properties/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'additional-fields[metric-property]'] = @api_client.build_collection_param(opts[:'additional_fields_metric_property'], :csv) if !opts[:'additional_fields_metric_property'].nil? + query_params[:'fields[metric-property]'] = @api_client.build_collection_param(opts[:'fields_metric_property'], :csv) if !opts[:'fields_metric_property'].nil? + query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_metric_property", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_metric_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Metric Relationships Flow Triggers + # Get all flows where the given metric is being used as the trigger.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `flows:read` `metrics:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_metric_relationships_flow_triggers(id, opts = {}) + data, _status_code, _headers = get_metric_relationships_flow_triggers_with_http_info(id, opts) + data + end + + # Get Metric Relationships Flow Triggers + # Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_metric_relationships_flow_triggers_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_relationships_flow_triggers ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_relationships_flow_triggers" + end + # resource path + local_var_path = '/api/metrics/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_metric_relationships_flow_triggers", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_metric_relationships_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get Metrics # Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `metrics:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def get_metrics(opts = {}) data, _status_code, _headers = get_metrics_with_http_info(opts) @@ -106,33 +501,45 @@ def get_metrics(opts = {}) # Get Metrics # Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`integration.name`: `equals`<br>`integration.category`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_metrics_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.get_metrics ...' end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end allowable_values = ["name", "created", "updated", "integration"] if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}" end + allowable_values = ["flow-triggers"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end # resource path - local_var_path = '/api/metrics/' + local_var_path = '/api/metrics' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -163,6 +570,162 @@ def get_metrics_with_http_info(opts = {}) return data, status_code, headers end + # Get Properties for Metric + # Get the metric properties for the given metric ID.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric + # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' + # @option opts [Array] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_properties_for_metric(id, opts = {}) + data, _status_code, _headers = get_properties_for_metric_with_http_info(id, opts) + data + end + + # alias of `get_properties_for_metric` + alias get_metric_metric_properties get_properties_for_metric + + # Get Properties for Metric + # Get the metric properties for the given metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric + # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_metric_property Request additional fields not included by default in the response. Supported values: 'sample_values' + # @option opts [Array] :fields_metric_property For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_properties_for_metric_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_properties_for_metric ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_properties_for_metric" + end + allowable_values = ["sample_values"] + if @api_client.config.client_side_validation && opts[:'additional_fields_metric_property'] && !opts[:'additional_fields_metric_property'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"additional_fields_metric_property\", must include one of #{allowable_values}" + end + allowable_values = ["label", "property", "inferred_type", "sample_values"] + if @api_client.config.client_side_validation && opts[:'fields_metric_property'] && !opts[:'fields_metric_property'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_metric_property\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/metrics/{id}/metric-properties'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'additional-fields[metric-property]'] = @api_client.build_collection_param(opts[:'additional_fields_metric_property'], :csv) if !opts[:'additional_fields_metric_property'].nil? + query_params[:'fields[metric-property]'] = @api_client.build_collection_param(opts[:'fields_metric_property'], :csv) if !opts[:'fields_metric_property'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_properties_for_metric", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_properties_for_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_properties_for_metric_with_http_info` + alias get_metric_metric_properties_with_http_info get_properties_for_metric_with_http_info + + # Get Property IDs for Metric + # Get the IDs of metric properties for the given metric.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_property_ids_for_metric(id, opts = {}) + data, _status_code, _headers = get_property_ids_for_metric_with_http_info(id, opts) + data + end + + # alias of `get_property_ids_for_metric` + alias get_metric_relationships_metric_properties get_property_ids_for_metric + + # Get Property IDs for Metric + # Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read` + # @param id [String] The ID of the metric + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_property_ids_for_metric_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MetricsApi.get_property_ids_for_metric ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_property_ids_for_metric" + end + # resource path + local_var_path = '/api/metrics/{id}/relationships/metric-properties'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"MetricsApi.get_property_ids_for_metric", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MetricsApi#get_property_ids_for_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_property_ids_for_metric_with_http_info` + alias get_metric_relationships_metric_properties_with_http_info get_property_ids_for_metric_with_http_info + # Query Metric Aggregates # Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events. Queries must be passed in the JSON body of your `POST` request. To request campaign and flow performance data that matches the data shown in Klaviyo's UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview). Results can be filtered and grouped by time, event, or profile dimensions. To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint). For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `metrics:read` # @param metric_aggregate_query [MetricAggregateQuery] Retrieve Metric Aggregations @@ -190,7 +753,7 @@ def query_metric_aggregates_with_http_info(metric_aggregate_query, opts = {}) fail ArgumentError, "Missing the required parameter 'metric_aggregate_query' when calling MetricsApi.query_metric_aggregates" end # resource path - local_var_path = '/api/metric-aggregates/' + local_var_path = '/api/metric-aggregates' # query parameters query_params = opts[:query_params] || {} @@ -198,11 +761,11 @@ def query_metric_aggregates_with_http_info(metric_aggregate_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/profiles_api.rb b/lib/klaviyo-api-sdk/api/profiles_api.rb index d0addc0..315be56 100644 --- a/lib/klaviyo-api-sdk/api/profiles_api.rb +++ b/lib/klaviyo-api-sdk/api/profiles_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -19,6 +19,334 @@ class ProfilesApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Bulk Subscribe Profiles + # Subscribe one or more profiles to email marketing, SMS marketing, or both. If the provided 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. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). If a list is not provided, the opt-in process used will be determined by the [account-level default opt-in setting](https://www.klaviyo.com/settings/account/api-keys). To add someone to a list without changing their subscription status, use [Add Profile to List](https://developers.klaviyo.com/en/reference/create_list_relationships). This API will remove any `UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about [suppressed profiles](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1). Maximum number of profiles can be submitted for subscription: 1000 This endpoint now supports a `historical_import` flag. If this flag is set `true`, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated \"Added to list\" flows. This is useful for importing historical data where you have already collected consent. If `historical_import` is set to true, the `consented_at` field is required and must be in the past.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` + # @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. + # @param [Hash] opts the optional parameters + # @return [nil] + def bulk_subscribe_profiles(subscription_create_job_create_query, opts = {}) + bulk_subscribe_profiles_with_http_info(subscription_create_job_create_query, opts) + nil + end + + # alias of `bulk_subscribe_profiles` + alias subscribe_profiles bulk_subscribe_profiles + + # alias of `bulk_subscribe_profiles` + alias create_profile_subscription_bulk_create_job bulk_subscribe_profiles + + # Bulk Subscribe Profiles + # Subscribe one or more profiles to email marketing, SMS marketing, or both. If the provided 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. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). If a list is not provided, the opt-in process used will be determined by the [account-level default opt-in setting](https://www.klaviyo.com/settings/account/api-keys). To add someone to a list without changing their subscription status, use [Add Profile to List](https://developers.klaviyo.com/en/reference/create_list_relationships). This API will remove any `UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about [suppressed profiles](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1). Maximum number of profiles can be submitted for subscription: 1000 This endpoint now supports a `historical_import` flag. If this flag is set `true`, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated \"Added to list\" flows. This is useful for importing historical data where you have already collected consent. If `historical_import` is set to true, the `consented_at` field is required and must be in the past.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` + # @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. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def bulk_subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_subscribe_profiles ...' + end + # verify the required parameter 'subscription_create_job_create_query' is set + if @api_client.config.client_side_validation && subscription_create_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'subscription_create_job_create_query' when calling ProfilesApi.bulk_subscribe_profiles" + end + # resource path + local_var_path = '/api/profile-subscription-bulk-create-jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_create_job_create_query) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ProfilesApi.bulk_subscribe_profiles", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProfilesApi#bulk_subscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `bulk_subscribe_profiles_with_http_info` + alias subscribe_profiles_with_http_info bulk_subscribe_profiles_with_http_info + + # alias of `bulk_subscribe_profiles_with_http_info` + alias create_profile_subscription_bulk_create_job_with_http_info bulk_subscribe_profiles_with_http_info + + # Bulk Suppress Profiles + # Manually suppress profiles by email address or specify a segment/list ID to suppress all current members of a segment/list. Suppressed profiles cannot receive email marketing, independent of their consent status. To learn more, see our guides on [email suppressions](https://help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:write` `subscriptions:write` + # @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. + # @param [Hash] opts the optional parameters + # @return [Hash] + def bulk_suppress_profiles(suppression_create_job_create_query, opts = {}) + data, _status_code, _headers = bulk_suppress_profiles_with_http_info(suppression_create_job_create_query, opts) + data + end + + # alias of `bulk_suppress_profiles` + alias suppress_profiles bulk_suppress_profiles + + # alias of `bulk_suppress_profiles` + alias create_profile_suppression_bulk_create_job bulk_suppress_profiles + + # Bulk Suppress Profiles + # Manually suppress profiles by email address or specify a segment/list ID to suppress all current members of a segment/list. Suppressed profiles cannot receive email marketing, independent of their consent status. To learn more, see our guides on [email suppressions](https://help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:write` `subscriptions:write` + # @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. + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_suppress_profiles ...' + end + # verify the required parameter 'suppression_create_job_create_query' is set + if @api_client.config.client_side_validation && suppression_create_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'suppression_create_job_create_query' when calling ProfilesApi.bulk_suppress_profiles" + end + # resource path + local_var_path = '/api/profile-suppression-bulk-create-jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_create_job_create_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ProfilesApi.bulk_suppress_profiles", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProfilesApi#bulk_suppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `bulk_suppress_profiles_with_http_info` + alias suppress_profiles_with_http_info bulk_suppress_profiles_with_http_info + + # alias of `bulk_suppress_profiles_with_http_info` + alias create_profile_suppression_bulk_create_job_with_http_info bulk_suppress_profiles_with_http_info + + # Bulk Unsubscribe Profiles + # Unsubscribe one or more profiles to email marketing, SMS marketing, or both. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). To remove someone from a list without changing their subscription status, use [Remove Profile from List](https://developers.klaviyo.com/en/reference/delete_list_relationships). Maximum number of profile can be submitted for unsubscription: 100

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` + # @param subscription_delete_job_create_query [SubscriptionDeleteJobCreateQuery] 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. + # @param [Hash] opts the optional parameters + # @return [nil] + def bulk_unsubscribe_profiles(subscription_delete_job_create_query, opts = {}) + bulk_unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts) + nil + end + + # alias of `bulk_unsubscribe_profiles` + alias unsubscribe_profiles bulk_unsubscribe_profiles + + # alias of `bulk_unsubscribe_profiles` + alias create_profile_subscription_bulk_delete_job bulk_unsubscribe_profiles + + # Bulk Unsubscribe Profiles + # Unsubscribe one or more profiles to email marketing, SMS marketing, or both. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). To remove someone from a list without changing their subscription status, use [Remove Profile from List](https://developers.klaviyo.com/en/reference/delete_list_relationships). Maximum number of profile can be submitted for unsubscription: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` + # @param subscription_delete_job_create_query [SubscriptionDeleteJobCreateQuery] 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. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def bulk_unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_unsubscribe_profiles ...' + end + # verify the required parameter 'subscription_delete_job_create_query' is set + if @api_client.config.client_side_validation && subscription_delete_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'subscription_delete_job_create_query' when calling ProfilesApi.bulk_unsubscribe_profiles" + end + # resource path + local_var_path = '/api/profile-subscription-bulk-delete-jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_delete_job_create_query) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ProfilesApi.bulk_unsubscribe_profiles", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProfilesApi#bulk_unsubscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `bulk_unsubscribe_profiles_with_http_info` + alias unsubscribe_profiles_with_http_info bulk_unsubscribe_profiles_with_http_info + + # alias of `bulk_unsubscribe_profiles_with_http_info` + alias create_profile_subscription_bulk_delete_job_with_http_info bulk_unsubscribe_profiles_with_http_info + + # Bulk Unsuppress Profiles + # Manually unsuppress profiles by email address or specify a segment/list ID to unsuppress all current members of a segment/list. This only removes suppressions with reason USER_SUPPRESSED ; unsubscribed profiles and suppressed profiles with reason INVALID_EMAIL or HARD_BOUNCE remain unchanged. To learn more, see our guides on [email suppressions](https://help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `subscriptions:write` + # @param suppression_delete_job_create_query [SuppressionDeleteJobCreateQuery] 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. + # @param [Hash] opts the optional parameters + # @return [Hash] + def bulk_unsuppress_profiles(suppression_delete_job_create_query, opts = {}) + data, _status_code, _headers = bulk_unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts) + data + end + + # alias of `bulk_unsuppress_profiles` + alias unsuppress_profiles bulk_unsuppress_profiles + + # alias of `bulk_unsuppress_profiles` + alias create_profile_suppression_bulk_delete_job bulk_unsuppress_profiles + + # Bulk Unsuppress Profiles + # Manually unsuppress profiles by email address or specify a segment/list ID to unsuppress all current members of a segment/list. This only removes suppressions with reason USER_SUPPRESSED ; unsubscribed profiles and suppressed profiles with reason INVALID_EMAIL or HARD_BOUNCE remain unchanged. To learn more, see our guides on [email suppressions](https://help.klaviyo.com/hc/en-us/articles/115005246108#what-is-a-suppressed-profile-1) and [collecting consent](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email address per request limit: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `subscriptions:write` + # @param suppression_delete_job_create_query [SuppressionDeleteJobCreateQuery] 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. + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def bulk_unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProfilesApi.bulk_unsuppress_profiles ...' + end + # verify the required parameter 'suppression_delete_job_create_query' is set + if @api_client.config.client_side_validation && suppression_delete_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'suppression_delete_job_create_query' when calling ProfilesApi.bulk_unsuppress_profiles" + end + # resource path + local_var_path = '/api/profile-suppression-bulk-delete-jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_delete_job_create_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ProfilesApi.bulk_unsuppress_profiles", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProfilesApi#bulk_unsuppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `bulk_unsuppress_profiles_with_http_info` + alias unsuppress_profiles_with_http_info bulk_unsuppress_profiles_with_http_info + + # alias of `bulk_unsuppress_profiles_with_http_info` + alias create_profile_suppression_bulk_delete_job_with_http_info bulk_unsuppress_profiles_with_http_info + # Create or Update Profile # Given a set of profile attributes and optionally an ID, create or update a profile. Returns 201 if a new profile was created, 200 if an existing profile was updated. Note that setting a field to `null` will clear out the field, whereas not including a field in your request will leave it unchanged.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:write` # @param profile_upsert_query [ProfileUpsertQuery] @@ -46,7 +374,7 @@ def create_or_update_profile_with_http_info(profile_upsert_query, opts = {}) fail ArgumentError, "Missing the required parameter 'profile_upsert_query' when calling ProfilesApi.create_or_update_profile" end # resource path - local_var_path = '/api/profile-import/' + local_var_path = '/api/profile-import' # query parameters query_params = opts[:query_params] || {} @@ -54,11 +382,11 @@ def create_or_update_profile_with_http_info(profile_upsert_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -119,7 +447,7 @@ def create_profile_with_http_info(profile_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'profile_create_query' when calling ProfilesApi.create_profile" end # resource path - local_var_path = '/api/profiles/' + local_var_path = '/api/profiles' # query parameters query_params = opts[:query_params] || {} @@ -127,11 +455,11 @@ def create_profile_with_http_info(profile_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -189,7 +517,7 @@ def create_push_token_with_http_info(push_token_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'push_token_create_query' when calling ProfilesApi.create_push_token" end # resource path - local_var_path = '/api/push-tokens/' + local_var_path = '/api/push-tokens' # query parameters query_params = opts[:query_params] || {} @@ -197,11 +525,11 @@ def create_push_token_with_http_info(push_token_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -235,37 +563,40 @@ def create_push_token_with_http_info(push_token_create_query, opts = {}) return data, status_code, headers end - # Get Bulk Profile Import Job + # Get Bulk Import Profiles Job # Get a bulk profile import job with the given job ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` `profiles:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_bulk_profile_import_job(job_id, opts = {}) - data, _status_code, _headers = get_bulk_profile_import_job_with_http_info(job_id, opts) + def get_bulk_import_profiles_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_import_profiles_job_with_http_info(job_id, opts) data end - # alias of `get_bulk_profile_import_job` - alias get_profile_bulk_import_job get_bulk_profile_import_job + # alias of `get_bulk_import_profiles_job` + alias get_bulk_profile_import_job get_bulk_import_profiles_job + + # alias of `get_bulk_import_profiles_job` + alias get_profile_bulk_import_job get_bulk_import_profiles_job - # Get Bulk Profile Import Job + # Get Bulk Import Profiles Job # Get a bulk profile import job with the given job ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` `profiles:read` # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_job_with_http_info(job_id, opts = {}) + def get_bulk_import_profiles_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_job ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_import_profiles_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? - fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_profile_import_job" + fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_import_profiles_job" end allowable_values = ["name", "created", "updated", "opt_in_process"] if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } @@ -275,25 +606,127 @@ def get_bulk_profile_import_job_with_http_info(job_id, opts = {}) if @api_client.config.client_side_validation && opts[:'fields_profile_bulk_import_job'] && !opts[:'fields_profile_bulk_import_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_profile_bulk_import_job\", must include one of #{allowable_values}" end - allowable_values = ["lists"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + allowable_values = ["lists"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/profile-bulk-import-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? + query_params[:'fields[profile-bulk-import-job]'] = @api_client.build_collection_param(opts[:'fields_profile_bulk_import_job'], :csv) if !opts[:'fields_profile_bulk_import_job'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ProfilesApi.get_bulk_import_profiles_job", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_bulk_import_profiles_job_with_http_info` + alias get_bulk_profile_import_job_with_http_info get_bulk_import_profiles_job_with_http_info + + # alias of `get_bulk_import_profiles_job_with_http_info` + alias get_profile_bulk_import_job_with_http_info get_bulk_import_profiles_job_with_http_info + + # Get Bulk Import Profiles Jobs + # Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` `profiles:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Hash] + def get_bulk_import_profiles_jobs(opts = {}) + data, _status_code, _headers = get_bulk_import_profiles_jobs_with_http_info(opts) + data + end + + # alias of `get_bulk_import_profiles_jobs` + alias get_bulk_profile_import_jobs get_bulk_import_profiles_jobs + + # alias of `get_bulk_import_profiles_jobs` + alias get_profile_bulk_import_jobs get_bulk_import_profiles_jobs + + # Get Bulk Import Profiles Jobs + # Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` `profiles:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_bulk_import_profiles_jobs_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_import_profiles_jobs ...' + end + allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "started_at"] + if @api_client.config.client_side_validation && opts[:'fields_profile_bulk_import_job'] && !opts[:'fields_profile_bulk_import_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile_bulk_import_job\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_import_profiles_jobs, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_import_profiles_jobs, must be greater than or equal to 1.' + end + + allowable_values = ["created_at", "-created_at"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/profile-bulk-import-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) + local_var_path = '/api/profile-bulk-import-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? query_params[:'fields[profile-bulk-import-job]'] = @api_client.build_collection_param(opts[:'fields_profile_bulk_import_job'], :csv) if !opts[:'fields_profile_bulk_import_job'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -308,7 +741,7 @@ def get_bulk_profile_import_job_with_http_info(job_id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_job", + :operation => :"ProfilesApi.get_bulk_import_profiles_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -319,73 +752,62 @@ def get_bulk_profile_import_job_with_http_info(job_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_import_profiles_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_job_with_http_info` - alias get_profile_bulk_import_job_with_http_info get_bulk_profile_import_job_with_http_info + # alias of `get_bulk_import_profiles_jobs_with_http_info` + alias get_bulk_profile_import_jobs_with_http_info get_bulk_import_profiles_jobs_with_http_info - # Get Bulk Profile Import Job Errors - # Get import errors for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:read` - # @param id [String] + # alias of `get_bulk_import_profiles_jobs_with_http_info` + alias get_profile_bulk_import_jobs_with_http_info get_bulk_import_profiles_jobs_with_http_info + + # Get Bulk Suppress Profiles Job + # Get the bulk suppress profiles job with the given job ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `subscriptions:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [Array] :fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_bulk_profile_import_job_import_errors(id, opts = {}) - data, _status_code, _headers = get_bulk_profile_import_job_import_errors_with_http_info(id, opts) + def get_bulk_suppress_profiles_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_suppress_profiles_job_with_http_info(job_id, opts) data end - # alias of `get_bulk_profile_import_job_import_errors` - alias get_profile_bulk_import_job_import_errors get_bulk_profile_import_job_import_errors + # alias of `get_bulk_suppress_profiles_job` + alias get_profile_suppression_bulk_create_job get_bulk_suppress_profiles_job - # Get Bulk Profile Import Job Errors - # Get import errors for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:read` - # @param id [String] + # Get Bulk Suppress Profiles Job + # Get the bulk suppress profiles job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `subscriptions:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [Array] :fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_job_import_errors_with_http_info(id, opts = {}) + def get_bulk_suppress_profiles_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_job_import_errors ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_bulk_profile_import_job_import_errors" + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_suppress_profiles_job ...' end - allowable_values = ["code", "title", "detail", "source", "source.pointer", "original_payload"] - if @api_client.config.client_side_validation && opts[:'fields_import_error'] && !opts[:'fields_import_error'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_import_error\", must include one of #{allowable_values}" - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_job_import_errors, must be smaller than or equal to 100.' + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_suppress_profiles_job" end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_job_import_errors, must be greater than or equal to 1.' + allowable_values = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_count"] + if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_create_job'] && !opts[:'fields_profile_suppression_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_create_job\", must include one of #{allowable_values}" end - # resource path - local_var_path = '/api/profile-bulk-import-jobs/{id}/import-errors/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-suppression-bulk-create-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[import-error]'] = @api_client.build_collection_param(opts[:'fields_import_error'], :csv) if !opts[:'fields_import_error'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'fields[profile-suppression-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_create_job'], :csv) if !opts[:'fields_profile_suppression_bulk_create_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -400,7 +822,7 @@ def get_bulk_profile_import_job_import_errors_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_job_import_errors", + :operation => :"ProfilesApi.get_bulk_suppress_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -411,59 +833,66 @@ def get_bulk_profile_import_job_import_errors_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_job_import_errors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_suppress_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_job_import_errors_with_http_info` - alias get_profile_bulk_import_job_import_errors_with_http_info get_bulk_profile_import_job_import_errors_with_http_info + # alias of `get_bulk_suppress_profiles_job_with_http_info` + alias get_profile_suppression_bulk_create_job_with_http_info get_bulk_suppress_profiles_job_with_http_info - # Get Bulk Profile Import Job Lists - # Get list for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` - # @param id [String] + # Get Bulk Suppress Profiles Jobs + # Get the status of all bulk profile suppression jobs.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `subscriptions:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_bulk_profile_import_job_lists(id, opts = {}) - data, _status_code, _headers = get_bulk_profile_import_job_lists_with_http_info(id, opts) + def get_bulk_suppress_profiles_jobs(opts = {}) + data, _status_code, _headers = get_bulk_suppress_profiles_jobs_with_http_info(opts) data end - # alias of `get_bulk_profile_import_job_lists` - alias get_profile_bulk_import_job_lists get_bulk_profile_import_job_lists + # alias of `get_bulk_suppress_profiles_jobs` + alias get_profile_suppression_bulk_create_jobs get_bulk_suppress_profiles_jobs - # Get Bulk Profile Import Job Lists - # Get list for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` - # @param id [String] + # Get Bulk Suppress Profiles Jobs + # Get the status of all bulk profile suppression jobs.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `subscriptions:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile_suppression_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_job_lists_with_http_info(id, opts = {}) + def get_bulk_suppress_profiles_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_job_lists ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_suppress_profiles_jobs ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_bulk_profile_import_job_lists" + allowable_values = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_count"] + if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_create_job'] && !opts[:'fields_profile_suppression_bulk_create_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_create_job\", must include one of #{allowable_values}" end - allowable_values = ["name", "created", "updated", "opt_in_process"] - if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/profile-bulk-import-jobs/{id}/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-suppression-bulk-create-jobs' # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? + query_params[:'fields[profile-suppression-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_create_job'], :csv) if !opts[:'fields_profile_suppression_bulk_create_job'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -478,7 +907,7 @@ def get_bulk_profile_import_job_lists_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_job_lists", + :operation => :"ProfilesApi.get_bulk_suppress_profiles_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -489,80 +918,59 @@ def get_bulk_profile_import_job_lists_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_job_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_suppress_profiles_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_job_lists_with_http_info` - alias get_profile_bulk_import_job_lists_with_http_info get_bulk_profile_import_job_lists_with_http_info + # alias of `get_bulk_suppress_profiles_jobs_with_http_info` + alias get_profile_suppression_bulk_create_jobs_with_http_info get_bulk_suppress_profiles_jobs_with_http_info - # Get Bulk Profile Import Job Profiles - # Get profiles for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:read` - # @param id [String] + # Get Bulk Unsuppress Profiles Job + # Get the bulk unsuppress profiles job with the given job ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `subscriptions:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [Array] :fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_bulk_profile_import_job_profiles(id, opts = {}) - data, _status_code, _headers = get_bulk_profile_import_job_profiles_with_http_info(id, opts) + def get_bulk_unsuppress_profiles_job(job_id, opts = {}) + data, _status_code, _headers = get_bulk_unsuppress_profiles_job_with_http_info(job_id, opts) data end - # alias of `get_bulk_profile_import_job_profiles` - alias get_profile_bulk_import_job_profiles get_bulk_profile_import_job_profiles + # alias of `get_bulk_unsuppress_profiles_job` + alias get_profile_suppression_bulk_delete_job get_bulk_unsuppress_profiles_job - # Get Bulk Profile Import Job Profiles - # Get profiles for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:read` - # @param id [String] + # Get Bulk Unsuppress Profiles Job + # Get the bulk unsuppress profiles job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `subscriptions:read` + # @param job_id [String] ID of the job to retrieve. # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [Array] :fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_job_profiles_with_http_info(id, opts = {}) + def get_bulk_unsuppress_profiles_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_job_profiles ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_bulk_profile_import_job_profiles" - end - allowable_values = ["subscriptions", "predictive_analytics"] - if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" - end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] - if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_unsuppress_profiles_job ...' end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_job_profiles, must be smaller than or equal to 100.' + # verify the required parameter 'job_id' is set + if @api_client.config.client_side_validation && job_id.nil? + fail ArgumentError, "Missing the required parameter 'job_id' when calling ProfilesApi.get_bulk_unsuppress_profiles_job" end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_job_profiles, must be greater than or equal to 1.' + allowable_values = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_count"] + if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_delete_job'] && !opts[:'fields_profile_suppression_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_delete_job\", must include one of #{allowable_values}" end - # resource path - local_var_path = '/api/profile-bulk-import-jobs/{id}/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-suppression-bulk-delete-jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil? - query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'fields[profile-suppression-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_delete_job'], :csv) if !opts[:'fields_profile_suppression_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -577,7 +985,7 @@ def get_bulk_profile_import_job_profiles_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_job_profiles", + :operation => :"ProfilesApi.get_bulk_unsuppress_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -588,52 +996,66 @@ def get_bulk_profile_import_job_profiles_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_job_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_unsuppress_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_job_profiles_with_http_info` - alias get_profile_bulk_import_job_profiles_with_http_info get_bulk_profile_import_job_profiles_with_http_info + # alias of `get_bulk_unsuppress_profiles_job_with_http_info` + alias get_profile_suppression_bulk_delete_job_with_http_info get_bulk_unsuppress_profiles_job_with_http_info - # Get Bulk Profile Import Job Relationships Lists - # Get list relationship for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` - # @param id [String] + # Get Bulk Unsuppress Profiles Jobs + # Get all bulk unsuppress profiles jobs.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `subscriptions:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_bulk_profile_import_job_relationships_lists(id, opts = {}) - data, _status_code, _headers = get_bulk_profile_import_job_relationships_lists_with_http_info(id, opts) + def get_bulk_unsuppress_profiles_jobs(opts = {}) + data, _status_code, _headers = get_bulk_unsuppress_profiles_jobs_with_http_info(opts) data end - # alias of `get_bulk_profile_import_job_relationships_lists` - alias get_profile_bulk_import_job_relationships_lists get_bulk_profile_import_job_relationships_lists + # alias of `get_bulk_unsuppress_profiles_jobs` + alias get_profile_suppression_bulk_delete_jobs get_bulk_unsuppress_profiles_jobs - # Get Bulk Profile Import Job Relationships Lists - # Get list relationship for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` - # @param id [String] + # Get Bulk Unsuppress Profiles Jobs + # Get all bulk unsuppress profiles jobs.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `subscriptions:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_profile_suppression_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`<br>`list_id`: `equals`<br>`segment_id`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_job_relationships_lists_with_http_info(id, opts = {}) + def get_bulk_unsuppress_profiles_jobs_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_job_relationships_lists ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_unsuppress_profiles_jobs ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_bulk_profile_import_job_relationships_lists" + allowable_values = ["status", "created_at", "total_count", "completed_count", "completed_at", "skipped_count"] + if @api_client.config.client_side_validation && opts[:'fields_profile_suppression_bulk_delete_job'] && !opts[:'fields_profile_suppression_bulk_delete_job'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile_suppression_bulk_delete_job\", must include one of #{allowable_values}" + end + allowable_values = ["created", "-created"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/profile-bulk-import-jobs/{id}/relationships/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-suppression-bulk-delete-jobs' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[profile-suppression-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_profile_suppression_bulk_delete_job'], :csv) if !opts[:'fields_profile_suppression_bulk_delete_job'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -648,7 +1070,7 @@ def get_bulk_profile_import_job_relationships_lists_with_http_info(id, opts = {} auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_job_relationships_lists", + :operation => :"ProfilesApi.get_bulk_unsuppress_profiles_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -659,66 +1081,76 @@ def get_bulk_profile_import_job_relationships_lists_with_http_info(id, opts = {} data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_job_relationships_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_unsuppress_profiles_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_job_relationships_lists_with_http_info` - alias get_profile_bulk_import_job_relationships_lists_with_http_info get_bulk_profile_import_job_relationships_lists_with_http_info + # alias of `get_bulk_unsuppress_profiles_jobs_with_http_info` + alias get_profile_suppression_bulk_delete_jobs_with_http_info get_bulk_unsuppress_profiles_jobs_with_http_info - # Get Bulk Profile Import Job Relationships Profiles - # Get profile relationships for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:read` + # Get Errors for Bulk Import Profiles Job + # Get import errors for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) # @return [Hash] - def get_bulk_profile_import_job_relationships_profiles(id, opts = {}) - data, _status_code, _headers = get_bulk_profile_import_job_relationships_profiles_with_http_info(id, opts) + def get_errors_for_bulk_import_profiles_job(id, opts = {}) + data, _status_code, _headers = get_errors_for_bulk_import_profiles_job_with_http_info(id, opts) data end - # alias of `get_bulk_profile_import_job_relationships_profiles` - alias get_profile_bulk_import_job_relationships_profiles get_bulk_profile_import_job_relationships_profiles + # alias of `get_errors_for_bulk_import_profiles_job` + alias get_bulk_profile_import_job_import_errors get_errors_for_bulk_import_profiles_job - # Get Bulk Profile Import Job Relationships Profiles - # Get profile relationships for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:read` + # alias of `get_errors_for_bulk_import_profiles_job` + alias get_profile_bulk_import_job_import_errors get_errors_for_bulk_import_profiles_job + + # Get Errors for Bulk Import Profiles Job + # Get import errors for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_import_error For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_job_relationships_profiles_with_http_info(id, opts = {}) + def get_errors_for_bulk_import_profiles_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_job_relationships_profiles ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_errors_for_bulk_import_profiles_job ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_bulk_profile_import_job_relationships_profiles" + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_errors_for_bulk_import_profiles_job" + end + allowable_values = ["code", "title", "detail", "source", "source.pointer", "original_payload"] + if @api_client.config.client_side_validation && opts[:'fields_import_error'] && !opts[:'fields_import_error'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_import_error\", must include one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_job_relationships_profiles, must be smaller than or equal to 100.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_errors_for_bulk_import_profiles_job, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_job_relationships_profiles, must be greater than or equal to 1.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_errors_for_bulk_import_profiles_job, must be greater than or equal to 1.' end # resource path - local_var_path = '/api/profile-bulk-import-jobs/{id}/relationships/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-bulk-import-jobs/{id}/import-errors'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[import-error]'] = @api_client.build_collection_param(opts[:'fields_import_error'], :csv) if !opts[:'fields_import_error'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -733,7 +1165,7 @@ def get_bulk_profile_import_job_relationships_profiles_with_http_info(id, opts = auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_job_relationships_profiles", + :operation => :"ProfilesApi.get_errors_for_bulk_import_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -744,77 +1176,65 @@ def get_bulk_profile_import_job_relationships_profiles_with_http_info(id, opts = data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_job_relationships_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_errors_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_job_relationships_profiles_with_http_info` - alias get_profile_bulk_import_job_relationships_profiles_with_http_info get_bulk_profile_import_job_relationships_profiles_with_http_info + # alias of `get_errors_for_bulk_import_profiles_job_with_http_info` + alias get_bulk_profile_import_job_import_errors_with_http_info get_errors_for_bulk_import_profiles_job_with_http_info - # Get Bulk Profile Import Jobs - # Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` `profiles:read` + # alias of `get_errors_for_bulk_import_profiles_job_with_http_info` + alias get_profile_bulk_import_job_import_errors_with_http_info get_errors_for_bulk_import_profiles_job_with_http_info + + # Get List for Bulk Import Profiles Job + # Get list for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_bulk_profile_import_jobs(opts = {}) - data, _status_code, _headers = get_bulk_profile_import_jobs_with_http_info(opts) + def get_list_for_bulk_import_profiles_job(id, opts = {}) + data, _status_code, _headers = get_list_for_bulk_import_profiles_job_with_http_info(id, opts) data end - # alias of `get_bulk_profile_import_jobs` - alias get_profile_bulk_import_jobs get_bulk_profile_import_jobs + # alias of `get_list_for_bulk_import_profiles_job` + alias get_bulk_profile_import_job_lists get_list_for_bulk_import_profiles_job - # Get Bulk Profile Import Jobs - # Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` `profiles:read` + # alias of `get_list_for_bulk_import_profiles_job` + alias get_profile_bulk_import_job_lists get_list_for_bulk_import_profiles_job + + # Get List for Bulk Import Profiles Job + # Get list for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_profile_bulk_import_job For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `any`, `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_bulk_profile_import_jobs_with_http_info(opts = {}) + def get_list_for_bulk_import_profiles_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_bulk_profile_import_jobs ...' - end - allowable_values = ["status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "started_at"] - if @api_client.config.client_side_validation && opts[:'fields_profile_bulk_import_job'] && !opts[:'fields_profile_bulk_import_job'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_profile_bulk_import_job\", must include one of #{allowable_values}" - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_jobs, must be smaller than or equal to 100.' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_list_for_bulk_import_profiles_job ...' end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_bulk_profile_import_jobs, must be greater than or equal to 1.' + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_list_for_bulk_import_profiles_job" end - - allowable_values = ["created_at", "-created_at"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["name", "created", "updated", "opt_in_process"] + if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/profile-bulk-import-jobs/' + local_var_path = '/api/profile-bulk-import-jobs/{id}/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[profile-bulk-import-job]'] = @api_client.build_collection_param(opts[:'fields_profile_bulk_import_job'], :csv) if !opts[:'fields_profile_bulk_import_job'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -829,7 +1249,7 @@ def get_bulk_profile_import_jobs_with_http_info(opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_bulk_profile_import_jobs", + :operation => :"ProfilesApi.get_list_for_bulk_import_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -840,84 +1260,58 @@ def get_bulk_profile_import_jobs_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_bulk_profile_import_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_list_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `get_bulk_profile_import_jobs_with_http_info` - alias get_profile_bulk_import_jobs_with_http_info get_bulk_profile_import_jobs_with_http_info + # alias of `get_list_for_bulk_import_profiles_job_with_http_info` + alias get_bulk_profile_import_job_lists_with_http_info get_list_for_bulk_import_profiles_job_with_http_info - # Get Profile - # Get the profile with the given profile ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:read` + # alias of `get_list_for_bulk_import_profiles_job_with_http_info` + alias get_profile_bulk_import_job_lists_with_http_info get_list_for_bulk_import_profiles_job_with_http_info + + # Get List IDs for Bulk Import Profiles Job + # Get list relationship for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships # @return [Hash] - def get_profile(id, opts = {}) - data, _status_code, _headers = get_profile_with_http_info(id, opts) + def get_list_ids_for_bulk_import_profiles_job(id, opts = {}) + data, _status_code, _headers = get_list_ids_for_bulk_import_profiles_job_with_http_info(id, opts) data end - # Get Profile - # Get the profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:read` + # alias of `get_list_ids_for_bulk_import_profiles_job` + alias get_bulk_profile_import_job_relationships_lists get_list_ids_for_bulk_import_profiles_job + + # alias of `get_list_ids_for_bulk_import_profiles_job` + alias get_profile_bulk_import_job_relationships_lists get_list_ids_for_bulk_import_profiles_job + + # Get List IDs for Bulk Import Profiles Job + # Get list relationship for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_profile_with_http_info(id, opts = {}) + def get_list_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_list_ids_for_bulk_import_profiles_job ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile" - end - allowable_values = ["subscriptions", "predictive_analytics"] - if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" - end - allowable_values = ["name", "created", "updated", "opt_in_process"] - if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" - end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] - if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" - end - allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] - if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" - end - allowable_values = ["lists", "segments"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_list_ids_for_bulk_import_profiles_job" end # resource path - local_var_path = '/api/profiles/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-bulk-import-jobs/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil? - query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? - query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? - query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -932,7 +1326,7 @@ def get_profile_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_profile", + :operation => :"ProfilesApi.get_list_ids_for_bulk_import_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -943,53 +1337,55 @@ def get_profile_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_list_ids_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Profile Lists + # alias of `get_list_ids_for_bulk_import_profiles_job_with_http_info` + alias get_bulk_profile_import_job_relationships_lists_with_http_info get_list_ids_for_bulk_import_profiles_job_with_http_info + + # alias of `get_list_ids_for_bulk_import_profiles_job_with_http_info` + alias get_profile_bulk_import_job_relationships_lists_with_http_info get_list_ids_for_bulk_import_profiles_job_with_http_info + + # Get List IDs for Profile # Get list memberships for a profile with the given profile ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_profile_lists(id, opts = {}) - data, _status_code, _headers = get_profile_lists_with_http_info(id, opts) + def get_list_ids_for_profile(id, opts = {}) + data, _status_code, _headers = get_list_ids_for_profile_with_http_info(id, opts) data end - # Get Profile Lists + # alias of `get_list_ids_for_profile` + alias get_profile_relationships_lists get_list_ids_for_profile + + # Get List IDs for Profile # Get list memberships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_profile_lists_with_http_info(id, opts = {}) + def get_list_ids_for_profile_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_lists ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_list_ids_for_profile ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_lists" - end - allowable_values = ["name", "created", "updated", "opt_in_process"] - if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_list_ids_for_profile" end # resource path - local_var_path = '/api/profiles/{id}/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profiles/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1004,7 +1400,7 @@ def get_profile_lists_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_profile_lists", + :operation => :"ProfilesApi.get_list_ids_for_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1015,46 +1411,59 @@ def get_profile_lists_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_profile_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_list_ids_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Profile Relationships Lists + # alias of `get_list_ids_for_profile_with_http_info` + alias get_profile_relationships_lists_with_http_info get_list_ids_for_profile_with_http_info + + # Get Lists for Profile # Get list memberships for a profile with the given profile ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_profile_relationships_lists(id, opts = {}) - data, _status_code, _headers = get_profile_relationships_lists_with_http_info(id, opts) + def get_lists_for_profile(id, opts = {}) + data, _status_code, _headers = get_lists_for_profile_with_http_info(id, opts) data end - # Get Profile Relationships Lists + # alias of `get_lists_for_profile` + alias get_profile_lists get_lists_for_profile + + # Get Lists for Profile # Get list memberships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_profile_relationships_lists_with_http_info(id, opts = {}) + def get_lists_for_profile_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_relationships_lists ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_lists_for_profile ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_relationships_lists" + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_lists_for_profile" + end + allowable_values = ["name", "created", "updated", "opt_in_process"] + if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/profiles/{id}/relationships/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profiles/{id}/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1069,7 +1478,7 @@ def get_profile_relationships_lists_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_profile_relationships_lists", + :operation => :"ProfilesApi.get_lists_for_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1080,46 +1489,84 @@ def get_profile_relationships_lists_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_profile_relationships_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_lists_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Profile Relationships Segments - # Get segment membership relationships for a profile with the given profile ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `profiles:read` `segments:read` + # alias of `get_lists_for_profile_with_http_info` + alias get_profile_lists_with_http_info get_lists_for_profile_with_http_info + + # Get Profile + # Get the profile with the given profile ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_profile_relationships_segments(id, opts = {}) - data, _status_code, _headers = get_profile_relationships_segments_with_http_info(id, opts) + def get_profile(id, opts = {}) + data, _status_code, _headers = get_profile_with_http_info(id, opts) data end - # Get Profile Relationships Segments - # Get 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` + # Get Profile + # Get the profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' + # @option opts [Array] :fields_list For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_profile_relationships_segments_with_http_info(id, opts = {}) + def get_profile_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_relationships_segments ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_relationships_segments" + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile" + end + allowable_values = ["subscriptions", "predictive_analytics"] + if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" + end + allowable_values = ["name", "created", "updated", "opt_in_process"] + if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" + end + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] + if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" + end + allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] + if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" + end + allowable_values = ["lists", "segments"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/profiles/{id}/relationships/segments/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profiles/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil? + query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? + query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? + query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1134,7 +1581,7 @@ def get_profile_relationships_segments_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_profile_relationships_segments", + :operation => :"ProfilesApi.get_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1145,53 +1592,66 @@ def get_profile_relationships_segments_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_profile_relationships_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Profile Segments - # Get segment memberships for a profile with the given profile ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `profiles:read` `segments:read` + # Get Profile IDs for Bulk Import Profiles Job + # Get profile relationships for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) # @return [Hash] - def get_profile_segments(id, opts = {}) - data, _status_code, _headers = get_profile_segments_with_http_info(id, opts) + def get_profile_ids_for_bulk_import_profiles_job(id, opts = {}) + data, _status_code, _headers = get_profile_ids_for_bulk_import_profiles_job_with_http_info(id, opts) data end - # Get Profile Segments - # 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` + # alias of `get_profile_ids_for_bulk_import_profiles_job` + alias get_bulk_profile_import_job_relationships_profiles get_profile_ids_for_bulk_import_profiles_job + + # alias of `get_profile_ids_for_bulk_import_profiles_job` + alias get_profile_bulk_import_job_relationships_profiles get_profile_ids_for_bulk_import_profiles_job + + # Get Profile IDs for Bulk Import Profiles Job + # Get profile relationships for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_profile_segments_with_http_info(id, opts = {}) + def get_profile_ids_for_bulk_import_profiles_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_segments ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_ids_for_bulk_import_profiles_job ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_segments" + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_ids_for_bulk_import_profiles_job" end - allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] - if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profile_ids_for_bulk_import_profiles_job, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profile_ids_for_bulk_import_profiles_job, must be greater than or equal to 1.' end + # resource path - local_var_path = '/api/profiles/{id}/segments/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profile-bulk-import-jobs/{id}/relationships/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1206,7 +1666,7 @@ def get_profile_segments_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.get_profile_segments", + :operation => :"ProfilesApi.get_profile_ids_for_bulk_import_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1217,20 +1677,26 @@ def get_profile_segments_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#get_profile_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_profile_ids_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `get_profile_ids_for_bulk_import_profiles_job_with_http_info` + alias get_bulk_profile_import_job_relationships_profiles_with_http_info get_profile_ids_for_bulk_import_profiles_job_with_http_info + + # alias of `get_profile_ids_for_bulk_import_profiles_job_with_http_info` + alias get_profile_bulk_import_job_relationships_profiles_with_http_info get_profile_ids_for_bulk_import_profiles_job_with_http_info + # Get Profiles - # Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: `id`, `created`, `updated`, `email`, `subscriptions.email.marketing.suppression.timestamp`, `subscriptions.email.marketing.list_suppressions.timestamp`

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:
Burst: `10/s`
Steady: `150/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `profiles:read` + # Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: `id`, `created`, `updated`, `email`, `subscriptions.email.marketing.suppression.timestamp`, `subscriptions.email.marketing.list_suppressions.timestamp`

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:
Burst: `10/s`
Steady: `150/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `profiles:read` # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_profiles(opts = {}) data, _status_code, _headers = get_profiles_with_http_info(opts) @@ -1238,14 +1704,14 @@ def get_profiles(opts = {}) end # Get Profiles - # Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: `id`, `created`, `updated`, `email`, `subscriptions.email.marketing.suppression.timestamp`, `subscriptions.email.marketing.list_suppressions.timestamp`<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:<br>Burst: `10/s`<br>Steady: `150/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `profiles:read` + # Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: `id`, `created`, `updated`, `email`, `subscriptions.email.marketing.suppression.timestamp`, `subscriptions.email.marketing.list_suppressions.timestamp`<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[profile]=predictive_analytics` parameter in your API request:<br>Burst: `10/s`<br>Steady: `150/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `profiles:read` # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.suppression.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal`<br>`subscriptions.email.marketing.suppression.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.list_id` : `equals`<br>`subscriptions.email.marketing.list_suppressions.reason` : `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp` : `greater-than`, `greater-or-equal`, `less-than`, `less-or-equal` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`external_id`: `any`, `equals`<br>`_kx`: `equals`<br>`created`: `greater-than`, `less-than`<br>`updated`: `greater-than`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.reason`: `equals`<br>`subscriptions.email.marketing.list_suppressions.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`subscriptions.email.marketing.list_suppressions.list_id`: `equals`<br>`subscriptions.email.marketing.suppression.reason`: `equals`<br>`subscriptions.email.marketing.suppression.timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_profiles_with_http_info(opts = {}) if @api_client.config.debugging @@ -1255,7 +1721,7 @@ def get_profiles_with_http_info(opts = {}) if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" end @@ -1272,7 +1738,7 @@ def get_profiles_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/profiles/' + local_var_path = '/api/profiles' # query parameters query_params = opts[:query_params] || {} @@ -1286,9 +1752,9 @@ def get_profiles_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1319,55 +1785,81 @@ def get_profiles_with_http_info(opts = {}) return data, status_code, headers end - # Merge Profiles - # Merge a given related profile into a profile with the given profile ID. The profile provided under `relationships` (the \"source\" profile) will be merged into the profile provided by the ID in the base data object (the \"destination\" profile). This endpoint queues an asynchronous task which will merge data from the source profile into the destination profile, deleting the source profile in the process. This endpoint accepts only one source profile. To learn more about how profile data is preserved or overwritten during a merge, please [visit our Help Center](https://help.klaviyo.com/hc/en-us/articles/115005073847#merge-2-profiles3).

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:write` - # @param profile_merge_query [ProfileMergeQuery] + # Get Profiles for Bulk Import Profiles Job + # Get profiles for the bulk profile import job with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:read` + # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) # @return [Hash] - def merge_profiles(profile_merge_query, opts = {}) - data, _status_code, _headers = merge_profiles_with_http_info(profile_merge_query, opts) + def get_profiles_for_bulk_import_profiles_job(id, opts = {}) + data, _status_code, _headers = get_profiles_for_bulk_import_profiles_job_with_http_info(id, opts) data end - # alias of `merge_profiles` - alias create_profile_merge merge_profiles + # alias of `get_profiles_for_bulk_import_profiles_job` + alias get_bulk_profile_import_job_profiles get_profiles_for_bulk_import_profiles_job - # Merge Profiles - # Merge a given related profile into a profile with the given profile ID. The profile provided under `relationships` (the \"source\" profile) will be merged into the profile provided by the ID in the base data object (the \"destination\" profile). This endpoint queues an asynchronous task which will merge data from the source profile into the destination profile, deleting the source profile in the process. This endpoint accepts only one source profile. To learn more about how profile data is preserved or overwritten during a merge, please [visit our Help Center](https://help.klaviyo.com/hc/en-us/articles/115005073847#merge-2-profiles3).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:write` - # @param profile_merge_query [ProfileMergeQuery] + # alias of `get_profiles_for_bulk_import_profiles_job` + alias get_profile_bulk_import_job_profiles get_profiles_for_bulk_import_profiles_job + + # Get Profiles for Bulk Import Profiles Job + # Get profiles for the bulk profile import job with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:read` + # @param id [String] # @param [Hash] opts the optional parameters + # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def merge_profiles_with_http_info(profile_merge_query, opts = {}) + def get_profiles_for_bulk_import_profiles_job_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.merge_profiles ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profiles_for_bulk_import_profiles_job ...' end - # verify the required parameter 'profile_merge_query' is set - if @api_client.config.client_side_validation && profile_merge_query.nil? - fail ArgumentError, "Missing the required parameter 'profile_merge_query' when calling ProfilesApi.merge_profiles" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profiles_for_bulk_import_profiles_job" + end + allowable_values = ["subscriptions", "predictive_analytics"] + if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" + end + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] + if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profiles_for_bulk_import_profiles_job, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfilesApi.get_profiles_for_bulk_import_profiles_job, must be greater than or equal to 1.' + end + # resource path - local_var_path = '/api/profile-merge/' + local_var_path = '/api/profile-bulk-import-jobs/{id}/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'additional-fields[profile]'] = @api_client.build_collection_param(opts[:'additional_fields_profile'], :csv) if !opts[:'additional_fields_profile'].nil? + query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_merge_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -1376,7 +1868,7 @@ def merge_profiles_with_http_info(profile_merge_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.merge_profiles", + :operation => :"ProfilesApi.get_profiles_for_bulk_import_profiles_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1385,44 +1877,47 @@ def merge_profiles_with_http_info(profile_merge_query, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#merge_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_profiles_for_bulk_import_profiles_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `merge_profiles_with_http_info` - alias create_profile_merge_with_http_info merge_profiles_with_http_info + # alias of `get_profiles_for_bulk_import_profiles_job_with_http_info` + alias get_bulk_profile_import_job_profiles_with_http_info get_profiles_for_bulk_import_profiles_job_with_http_info - # Spawn Bulk Profile Import Job - # Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request. The maximum allowed payload size is 5MB. To learn more, see our [Bulk Profile Import API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_bulk_profile_import_api).

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:write` `profiles:write` - # @param profile_import_job_create_query [ProfileImportJobCreateQuery] + # alias of `get_profiles_for_bulk_import_profiles_job_with_http_info` + alias get_profile_bulk_import_job_profiles_with_http_info get_profiles_for_bulk_import_profiles_job_with_http_info + + # Get Segment IDs for Profile + # Get segment membership relationships for a profile with the given profile ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `profiles:read` `segments:read` + # @param id [String] # @param [Hash] opts the optional parameters # @return [Hash] - def spawn_bulk_profile_import_job(profile_import_job_create_query, opts = {}) - data, _status_code, _headers = spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query, opts) + def get_segment_ids_for_profile(id, opts = {}) + data, _status_code, _headers = get_segment_ids_for_profile_with_http_info(id, opts) data end - # alias of `spawn_bulk_profile_import_job` - alias create_profile_bulk_import_job spawn_bulk_profile_import_job + # alias of `get_segment_ids_for_profile` + alias get_profile_relationships_segments get_segment_ids_for_profile - # Spawn Bulk Profile Import Job - # Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request. The maximum allowed payload size is 5MB. To learn more, see our [Bulk Profile Import API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_bulk_profile_import_api).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:write` `profiles:write` - # @param profile_import_job_create_query [ProfileImportJobCreateQuery] + # Get Segment IDs for Profile + # Get 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` + # @param id [String] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query, opts = {}) + def get_segment_ids_for_profile_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.spawn_bulk_profile_import_job ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_segment_ids_for_profile ...' end - # verify the required parameter 'profile_import_job_create_query' is set - if @api_client.config.client_side_validation && profile_import_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'profile_import_job_create_query' when calling ProfilesApi.spawn_bulk_profile_import_job" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_segment_ids_for_profile" end # resource path - local_var_path = '/api/profile-bulk-import-jobs/' + local_var_path = '/api/profiles/{id}/relationships/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1430,20 +1925,15 @@ def spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_import_job_create_query) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -1452,7 +1942,7 @@ def spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.spawn_bulk_profile_import_job", + :operation => :"ProfilesApi.get_segment_ids_for_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1461,150 +1951,76 @@ def spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#spawn_bulk_profile_import_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_segment_ids_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `spawn_bulk_profile_import_job_with_http_info` - alias create_profile_bulk_import_job_with_http_info spawn_bulk_profile_import_job_with_http_info + # alias of `get_segment_ids_for_profile_with_http_info` + alias get_profile_relationships_segments_with_http_info get_segment_ids_for_profile_with_http_info - # Subscribe Profiles - # Subscribe one or more profiles to email marketing, SMS marketing, or both. If the provided 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. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). If a list is not provided, the opt-in process used will be determined by the [account-level default opt-in setting](https://www.klaviyo.com/settings/account/api-keys). To add someone to a list without changing their subscription status, use [Add Profile to List](https://developers.klaviyo.com/en/reference/create_list_relationships). This API will remove any `UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about [suppressed profiles](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1). Maximum number of profiles can be submitted for subscription: 1000 This endpoint now supports a `historical_import` flag. If this flag is set `true`, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated \"Added to list\" flows. This is useful for importing historical data where you have already collected consent. If `historical_import` is set to true, the `consented_at` field is required and must be in the past.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` - # @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. + # Get Segments for Profile + # Get segment memberships for a profile with the given profile ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `profiles:read` `segments:read` + # @param id [String] # @param [Hash] opts the optional parameters - # @return [nil] - def subscribe_profiles(subscription_create_job_create_query, opts = {}) - subscribe_profiles_with_http_info(subscription_create_job_create_query, opts) - nil + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_segments_for_profile(id, opts = {}) + data, _status_code, _headers = get_segments_for_profile_with_http_info(id, opts) + data end - # alias of `subscribe_profiles` - alias create_profile_subscription_bulk_create_job subscribe_profiles + # alias of `get_segments_for_profile` + alias get_profile_segments get_segments_for_profile - # Subscribe Profiles - # Subscribe one or more profiles to email marketing, SMS marketing, or both. If the provided 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. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). If a list is not provided, the opt-in process used will be determined by the [account-level default opt-in setting](https://www.klaviyo.com/settings/account/api-keys). To add someone to a list without changing their subscription status, use [Add Profile to List](https://developers.klaviyo.com/en/reference/create_list_relationships). This API will remove any `UNSUBSCRIBE`, `SPAM_REPORT` or `USER_SUPPRESSED` suppressions from the provided profiles. Learn more about [suppressed profiles](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1). Maximum number of profiles can be submitted for subscription: 1000 This endpoint now supports a `historical_import` flag. If this flag is set `true`, profiles being subscribed will bypass double opt-in emails and be subscribed immediately. They will also bypass any associated \"Added to list\" flows. This is useful for importing historical data where you have already collected consent. If `historical_import` is set to true, the `consented_at` field is required and must be in the past.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` - # @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. + # Get Segments for Profile + # 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` + # @param id [String] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.subscribe_profiles ...' - end - # verify the required parameter 'subscription_create_job_create_query' is set - if @api_client.config.client_side_validation && subscription_create_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'subscription_create_job_create_query' when calling ProfilesApi.subscribe_profiles" - end - # resource path - local_var_path = '/api/profile-subscription-bulk-create-jobs/' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_create_job_create_query) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] - - new_options = opts.merge( - :operation => :"ProfilesApi.subscribe_profiles", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_segments_for_profile_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#subscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug 'Calling API: ProfilesApi.get_segments_for_profile ...' end - return data, status_code, headers - end - - # alias of `subscribe_profiles_with_http_info` - alias create_profile_subscription_bulk_create_job_with_http_info subscribe_profiles_with_http_info - - # Suppress Profiles - # Manually suppress profiles using their email address, or by specifying a segment or list ID to suppress all current members. Suppressed profiles cannot receive email marketing, independent of their consent status. To learn more, see our [email suppressions guide](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1) and our [collecting consent guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email addresses per request limit: 100

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:write` `subscriptions:write` - # @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. - # @param [Hash] opts the optional parameters - # @return [nil] - def suppress_profiles(suppression_create_job_create_query, opts = {}) - suppress_profiles_with_http_info(suppression_create_job_create_query, opts) - nil - end - - # alias of `suppress_profiles` - alias create_profile_suppression_bulk_create_job suppress_profiles - - # Suppress Profiles - # Manually suppress profiles using their email address, or by specifying a segment or list ID to suppress all current members. Suppressed profiles cannot receive email marketing, independent of their consent status. To learn more, see our [email suppressions guide](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1) and our [collecting consent guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email addresses per request limit: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:write` `subscriptions:write` - # @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. - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.suppress_profiles ...' + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_segments_for_profile" end - # verify the required parameter 'suppression_create_job_create_query' is set - if @api_client.config.client_side_validation && suppression_create_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'suppression_create_job_create_query' when calling ProfilesApi.suppress_profiles" + allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] + if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/profile-suppression-bulk-create-jobs/' + local_var_path = '/api/profiles/{id}/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_create_job_create_query) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.suppress_profiles", + :operation => :"ProfilesApi.get_segments_for_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1613,44 +2029,44 @@ def suppress_profiles_with_http_info(suppression_create_job_create_query, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#suppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#get_segments_for_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `suppress_profiles_with_http_info` - alias create_profile_suppression_bulk_create_job_with_http_info suppress_profiles_with_http_info + # alias of `get_segments_for_profile_with_http_info` + alias get_profile_segments_with_http_info get_segments_for_profile_with_http_info - # Unsubscribe Profiles - # Unsubscribe one or more profiles to email marketing, SMS marketing, or both. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). To remove someone from a list without changing their subscription status, use [Remove Profile from List](https://developers.klaviyo.com/en/reference/delete_list_relationships). Maximum number of profile can be submitted for unsubscription: 100

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` - # @param subscription_delete_job_create_query [SubscriptionDeleteJobCreateQuery] 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. + # Merge Profiles + # Merge a given related profile into a profile with the given profile ID. The profile provided under `relationships` (the \"source\" profile) will be merged into the profile provided by the ID in the base data object (the \"destination\" profile). This endpoint queues an asynchronous task which will merge data from the source profile into the destination profile, deleting the source profile in the process. This endpoint accepts only one source profile. To learn more about how profile data is preserved or overwritten during a merge, please [visit our Help Center](https://help.klaviyo.com/hc/en-us/articles/115005073847#merge-2-profiles3).

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `profiles:write` + # @param profile_merge_query [ProfileMergeQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def unsubscribe_profiles(subscription_delete_job_create_query, opts = {}) - unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts) - nil + # @return [Hash] + def merge_profiles(profile_merge_query, opts = {}) + data, _status_code, _headers = merge_profiles_with_http_info(profile_merge_query, opts) + data end - # alias of `unsubscribe_profiles` - alias create_profile_subscription_bulk_delete_job unsubscribe_profiles + # alias of `merge_profiles` + alias create_profile_merge merge_profiles - # Unsubscribe Profiles - # Unsubscribe one or more profiles to email marketing, SMS marketing, or both. Learn more about [consent in this guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). To remove someone from a list without changing their subscription status, use [Remove Profile from List](https://developers.klaviyo.com/en/reference/delete_list_relationships). Maximum number of profile can be submitted for unsubscription: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `lists:write` `profiles:write` `subscriptions:write` - # @param subscription_delete_job_create_query [SubscriptionDeleteJobCreateQuery] 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. + # Merge Profiles + # Merge a given related profile into a profile with the given profile ID. The profile provided under `relationships` (the \"source\" profile) will be merged into the profile provided by the ID in the base data object (the \"destination\" profile). This endpoint queues an asynchronous task which will merge data from the source profile into the destination profile, deleting the source profile in the process. This endpoint accepts only one source profile. To learn more about how profile data is preserved or overwritten during a merge, please [visit our Help Center](https://help.klaviyo.com/hc/en-us/articles/115005073847#merge-2-profiles3).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `profiles:write` + # @param profile_merge_query [ProfileMergeQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def merge_profiles_with_http_info(profile_merge_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.unsubscribe_profiles ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.merge_profiles ...' end - # verify the required parameter 'subscription_delete_job_create_query' is set - if @api_client.config.client_side_validation && subscription_delete_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'subscription_delete_job_create_query' when calling ProfilesApi.unsubscribe_profiles" + # verify the required parameter 'profile_merge_query' is set + if @api_client.config.client_side_validation && profile_merge_query.nil? + fail ArgumentError, "Missing the required parameter 'profile_merge_query' when calling ProfilesApi.merge_profiles" end # resource path - local_var_path = '/api/profile-subscription-bulk-delete-jobs/' + local_var_path = '/api/profile-merge' # query parameters query_params = opts[:query_params] || {} @@ -1658,11 +2074,11 @@ def unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, op # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1671,16 +2087,16 @@ def unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, op form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_delete_job_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_merge_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.unsubscribe_profiles", + :operation => :"ProfilesApi.merge_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1691,42 +2107,45 @@ def unsubscribe_profiles_with_http_info(subscription_delete_job_create_query, op data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#unsubscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#merge_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `unsubscribe_profiles_with_http_info` - alias create_profile_subscription_bulk_delete_job_with_http_info unsubscribe_profiles_with_http_info + # alias of `merge_profiles_with_http_info` + alias create_profile_merge_with_http_info merge_profiles_with_http_info - # Unsuppress Profiles - # Manually unsuppress profiles using their email address, or by specifying a segment or list ID to unsuppress all current members. This only removes suppressions with reason `USER_SUPPRESSED`, leaving unsubscribed profiles and profiles suppressed with reason `INVALID_EMAIL` or `HARD_BOUNCE` unchanged. To learn more, see our [email suppressions guide](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1) and our [collecting consent guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email addresses per request limit: 100

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `subscriptions:write` - # @param suppression_delete_job_create_query [SuppressionDeleteJobCreateQuery] 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. + # Spawn Bulk Profile Import Job + # Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request. The maximum allowed payload size is 5MB. To learn more, see our [Bulk Profile Import API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_bulk_profile_import_api).

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `lists:write` `profiles:write` + # @param profile_import_job_create_query [ProfileImportJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [nil] - def unsuppress_profiles(suppression_delete_job_create_query, opts = {}) - unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts) - nil + # @return [Hash] + def spawn_bulk_profile_import_job(profile_import_job_create_query, opts = {}) + data, _status_code, _headers = spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query, opts) + data end - # alias of `unsuppress_profiles` - alias create_profile_suppression_bulk_delete_job unsuppress_profiles + # alias of `spawn_bulk_profile_import_job` + alias bulk_import_profiles spawn_bulk_profile_import_job - # Unsuppress Profiles - # Manually unsuppress profiles using their email address, or by specifying a segment or list ID to unsuppress all current members. This only removes suppressions with reason `USER_SUPPRESSED`, leaving unsubscribed profiles and profiles suppressed with reason `INVALID_EMAIL` or `HARD_BOUNCE` unchanged. To learn more, see our [email suppressions guide](https://help.klaviyo.com/hc/en-us/articles/115005246108-Understanding-suppressed-email-profiles#what-is-a-suppressed-profile-1) and our [collecting consent guide](https://developers.klaviyo.com/en/docs/collect_email_and_sms_consent_via_api). Email addresses per request limit: 100<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `subscriptions:write` - # @param suppression_delete_job_create_query [SuppressionDeleteJobCreateQuery] 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. + # alias of `spawn_bulk_profile_import_job` + alias create_profile_bulk_import_job spawn_bulk_profile_import_job + + # Spawn Bulk Profile Import Job + # Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request. The maximum allowed payload size is 5MB. To learn more, see our [Bulk Profile Import API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_bulk_profile_import_api).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `lists:write` `profiles:write` + # @param profile_import_job_create_query [ProfileImportJobCreateQuery] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def spawn_bulk_profile_import_job_with_http_info(profile_import_job_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ProfilesApi.unsuppress_profiles ...' + @api_client.config.logger.debug 'Calling API: ProfilesApi.spawn_bulk_profile_import_job ...' end - # verify the required parameter 'suppression_delete_job_create_query' is set - if @api_client.config.client_side_validation && suppression_delete_job_create_query.nil? - fail ArgumentError, "Missing the required parameter 'suppression_delete_job_create_query' when calling ProfilesApi.unsuppress_profiles" + # verify the required parameter 'profile_import_job_create_query' is set + if @api_client.config.client_side_validation && profile_import_job_create_query.nil? + fail ArgumentError, "Missing the required parameter 'profile_import_job_create_query' when calling ProfilesApi.spawn_bulk_profile_import_job" end # resource path - local_var_path = '/api/profile-suppression-bulk-delete-jobs/' + local_var_path = '/api/profile-bulk-import-jobs' # query parameters query_params = opts[:query_params] || {} @@ -1734,11 +2153,11 @@ def unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1747,16 +2166,16 @@ def unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_delete_job_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_import_job_create_query) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"ProfilesApi.unsuppress_profiles", + :operation => :"ProfilesApi.spawn_bulk_profile_import_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1767,13 +2186,16 @@ def unsuppress_profiles_with_http_info(suppression_delete_job_create_query, opts data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ProfilesApi#unsuppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ProfilesApi#spawn_bulk_profile_import_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `unsuppress_profiles_with_http_info` - alias create_profile_suppression_bulk_delete_job_with_http_info unsuppress_profiles_with_http_info + # alias of `spawn_bulk_profile_import_job_with_http_info` + alias bulk_import_profiles_with_http_info spawn_bulk_profile_import_job_with_http_info + + # alias of `spawn_bulk_profile_import_job_with_http_info` + alias create_profile_bulk_import_job_with_http_info spawn_bulk_profile_import_job_with_http_info # Update Profile # Update the profile with the given profile ID. Note that setting a field to `null` will clear out the field, whereas not including a field in your request will leave it unchanged.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:write` @@ -1805,7 +2227,7 @@ def update_profile_with_http_info(id, profile_partial_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'profile_partial_update_query' when calling ProfilesApi.update_profile" end # resource path - local_var_path = '/api/profiles/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/profiles/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1813,11 +2235,11 @@ def update_profile_with_http_info(id, profile_partial_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/reporting_api.rb b/lib/klaviyo-api-sdk/api/reporting_api.rb index ccc3bf8..2810b0d 100644 --- a/lib/klaviyo-api-sdk/api/reporting_api.rb +++ b/lib/klaviyo-api-sdk/api/reporting_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -23,7 +23,7 @@ def initialize(api_client = ApiClient.default) # Returns the requested campaign analytics values data

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `campaigns:read` # @param campaign_values_request_dto [CampaignValuesRequestDTO] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def query_campaign_values(campaign_values_request_dto, opts = {}) data, _status_code, _headers = query_campaign_values_with_http_info(campaign_values_request_dto, opts) @@ -37,7 +37,7 @@ def query_campaign_values(campaign_values_request_dto, opts = {}) # Returns the requested campaign analytics values data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `campaigns:read` # @param campaign_values_request_dto [CampaignValuesRequestDTO] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def query_campaign_values_with_http_info(campaign_values_request_dto, opts = {}) if @api_client.config.debugging @@ -48,7 +48,7 @@ def query_campaign_values_with_http_info(campaign_values_request_dto, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_values_request_dto' when calling ReportingApi.query_campaign_values" end # resource path - local_var_path = '/api/campaign-values-reports/' + local_var_path = '/api/campaign-values-reports' # query parameters query_params = opts[:query_params] || {} @@ -57,11 +57,11 @@ def query_campaign_values_with_http_info(campaign_values_request_dto, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -102,7 +102,7 @@ def query_campaign_values_with_http_info(campaign_values_request_dto, opts = {}) # Returns the requested flow analytics series data

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `flows:read` # @param flow_series_request_dto [FlowSeriesRequestDTO] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def query_flow_series(flow_series_request_dto, opts = {}) data, _status_code, _headers = query_flow_series_with_http_info(flow_series_request_dto, opts) @@ -116,7 +116,7 @@ def query_flow_series(flow_series_request_dto, opts = {}) # Returns the requested flow analytics series data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `flows:read` # @param flow_series_request_dto [FlowSeriesRequestDTO] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def query_flow_series_with_http_info(flow_series_request_dto, opts = {}) if @api_client.config.debugging @@ -127,7 +127,7 @@ def query_flow_series_with_http_info(flow_series_request_dto, opts = {}) fail ArgumentError, "Missing the required parameter 'flow_series_request_dto' when calling ReportingApi.query_flow_series" end # resource path - local_var_path = '/api/flow-series-reports/' + local_var_path = '/api/flow-series-reports' # query parameters query_params = opts[:query_params] || {} @@ -136,11 +136,11 @@ def query_flow_series_with_http_info(flow_series_request_dto, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -181,7 +181,7 @@ def query_flow_series_with_http_info(flow_series_request_dto, opts = {}) # Returns the requested flow analytics values data

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `flows:read` # @param flow_values_request_dto [FlowValuesRequestDTO] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Hash] def query_flow_values(flow_values_request_dto, opts = {}) data, _status_code, _headers = query_flow_values_with_http_info(flow_values_request_dto, opts) @@ -195,7 +195,7 @@ def query_flow_values(flow_values_request_dto, opts = {}) # Returns the requested flow analytics values data<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `flows:read` # @param flow_values_request_dto [FlowValuesRequestDTO] # @param [Hash] opts the optional parameters - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def query_flow_values_with_http_info(flow_values_request_dto, opts = {}) if @api_client.config.debugging @@ -206,7 +206,7 @@ def query_flow_values_with_http_info(flow_values_request_dto, opts = {}) fail ArgumentError, "Missing the required parameter 'flow_values_request_dto' when calling ReportingApi.query_flow_values" end # resource path - local_var_path = '/api/flow-values-reports/' + local_var_path = '/api/flow-values-reports' # query parameters query_params = opts[:query_params] || {} @@ -215,11 +215,11 @@ def query_flow_values_with_http_info(flow_values_request_dto, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -255,5 +255,309 @@ def query_flow_values_with_http_info(flow_values_request_dto, opts = {}) # alias of `query_flow_values_with_http_info` alias create_flow_value_report_with_http_info query_flow_values_with_http_info + + # Query Form Series + # Returns the requested form analytics series data.

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `forms:read` + # @param form_series_request_dto [FormSeriesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Hash] + def query_form_series(form_series_request_dto, opts = {}) + data, _status_code, _headers = query_form_series_with_http_info(form_series_request_dto, opts) + data + end + + # alias of `query_form_series` + alias create_form_sery_report query_form_series + + # Query Form Series + # Returns the requested form analytics series data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `forms:read` + # @param form_series_request_dto [FormSeriesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def query_form_series_with_http_info(form_series_request_dto, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportingApi.query_form_series ...' + end + # verify the required parameter 'form_series_request_dto' is set + if @api_client.config.client_side_validation && form_series_request_dto.nil? + fail ArgumentError, "Missing the required parameter 'form_series_request_dto' when calling ReportingApi.query_form_series" + end + # resource path + local_var_path = '/api/form-series-reports' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(form_series_request_dto) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ReportingApi.query_form_series", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReportingApi#query_form_series\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `query_form_series_with_http_info` + alias create_form_sery_report_with_http_info query_form_series_with_http_info + + # Query Form Values + # Returns the requested form analytics values data.

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `forms:read` + # @param form_values_request_dto [FormValuesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Hash] + def query_form_values(form_values_request_dto, opts = {}) + data, _status_code, _headers = query_form_values_with_http_info(form_values_request_dto, opts) + data + end + + # alias of `query_form_values` + alias create_form_value_report query_form_values + + # Query Form Values + # Returns the requested form analytics values data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `forms:read` + # @param form_values_request_dto [FormValuesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def query_form_values_with_http_info(form_values_request_dto, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportingApi.query_form_values ...' + end + # verify the required parameter 'form_values_request_dto' is set + if @api_client.config.client_side_validation && form_values_request_dto.nil? + fail ArgumentError, "Missing the required parameter 'form_values_request_dto' when calling ReportingApi.query_form_values" + end + # resource path + local_var_path = '/api/form-values-reports' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(form_values_request_dto) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ReportingApi.query_form_values", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReportingApi#query_form_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `query_form_values_with_http_info` + alias create_form_value_report_with_http_info query_form_values_with_http_info + + # Query Segment Series + # Returns the requested segment analytics series data.

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `segments:read` + # @param segment_series_request_dto [SegmentSeriesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Hash] + def query_segment_series(segment_series_request_dto, opts = {}) + data, _status_code, _headers = query_segment_series_with_http_info(segment_series_request_dto, opts) + data + end + + # alias of `query_segment_series` + alias create_segment_sery_report query_segment_series + + # Query Segment Series + # Returns the requested segment analytics series data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `segments:read` + # @param segment_series_request_dto [SegmentSeriesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def query_segment_series_with_http_info(segment_series_request_dto, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportingApi.query_segment_series ...' + end + # verify the required parameter 'segment_series_request_dto' is set + if @api_client.config.client_side_validation && segment_series_request_dto.nil? + fail ArgumentError, "Missing the required parameter 'segment_series_request_dto' when calling ReportingApi.query_segment_series" + end + # resource path + local_var_path = '/api/segment-series-reports' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(segment_series_request_dto) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ReportingApi.query_segment_series", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReportingApi#query_segment_series\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `query_segment_series_with_http_info` + alias create_segment_sery_report_with_http_info query_segment_series_with_http_info + + # Query Segment Values + # Returns the requested segment analytics values data.

*Rate limits*:
Burst: `1/s`
Steady: `2/m`
Daily: `225/d` **Scopes:** `segments:read` + # @param segment_values_request_dto [SegmentValuesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Hash] + def query_segment_values(segment_values_request_dto, opts = {}) + data, _status_code, _headers = query_segment_values_with_http_info(segment_values_request_dto, opts) + data + end + + # alias of `query_segment_values` + alias create_segment_value_report query_segment_values + + # Query Segment Values + # Returns the requested segment analytics values data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d` **Scopes:** `segments:read` + # @param segment_values_request_dto [SegmentValuesRequestDTO] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def query_segment_values_with_http_info(segment_values_request_dto, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportingApi.query_segment_values ...' + end + # verify the required parameter 'segment_values_request_dto' is set + if @api_client.config.client_side_validation && segment_values_request_dto.nil? + fail ArgumentError, "Missing the required parameter 'segment_values_request_dto' when calling ReportingApi.query_segment_values" + end + # resource path + local_var_path = '/api/segment-values-reports' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(segment_values_request_dto) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ReportingApi.query_segment_values", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReportingApi#query_segment_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `query_segment_values_with_http_info` + alias create_segment_value_report_with_http_info query_segment_values_with_http_info end end diff --git a/lib/klaviyo-api-sdk/api/reviews_api.rb b/lib/klaviyo-api-sdk/api/reviews_api.rb new file mode 100644 index 0000000..5e15aa2 --- /dev/null +++ b/lib/klaviyo-api-sdk/api/reviews_api.rb @@ -0,0 +1,212 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'cgi' + +module KlaviyoAPI + class ReviewsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get Review + # Get the review with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `reviews:read` + # @param id [String] The ID of the review + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @return [Hash] + def get_review(id, opts = {}) + data, _status_code, _headers = get_review_with_http_info(id, opts) + data + end + + # Get Review + # Get the review with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `reviews:read` + # @param id [String] The ID of the review + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_review_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReviewsApi.get_review ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ReviewsApi.get_review" + end + allowable_values = ["timestamp", "event_properties", "datetime", "uuid"] + if @api_client.config.client_side_validation && opts[:'fields_event'] && !opts[:'fields_event'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_event\", must include one of #{allowable_values}" + end + allowable_values = ["email", "status", "verified", "review_type", "created", "updated", "images", "product", "product.url", "product.name", "product.image_url", "rating", "author", "content", "title", "smart_quote", "public_reply", "public_reply.content", "public_reply.author", "public_reply.updated"] + if @api_client.config.client_side_validation && opts[:'fields_review'] && !opts[:'fields_review'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_review\", must include one of #{allowable_values}" + end + allowable_values = ["events"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/reviews/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[event]'] = @api_client.build_collection_param(opts[:'fields_event'], :csv) if !opts[:'fields_event'].nil? + query_params[:'fields[review]'] = @api_client.build_collection_param(opts[:'fields_review'], :csv) if !opts[:'fields_review'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ReviewsApi.get_review", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReviewsApi#get_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Reviews + # Get all reviews.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `reviews:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Hash] + def get_reviews(opts = {}) + data, _status_code, _headers = get_reviews_with_http_info(opts) + data + end + + # Get Reviews + # Get all reviews.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `reviews:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_event For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_review For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`created`: `greater-or-equal`, `less-or-equal`<br>`rating`: `any`, `equals`, `greater-or-equal`, `less-or-equal`<br>`id`: `any`, `equals`<br>`item.id`: `any`, `equals`<br>`content`: `contains`<br>`status`: `equals`<br>`review_type`: `equals`<br>`verified`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_reviews_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReviewsApi.get_reviews ...' + end + allowable_values = ["timestamp", "event_properties", "datetime", "uuid"] + if @api_client.config.client_side_validation && opts[:'fields_event'] && !opts[:'fields_event'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_event\", must include one of #{allowable_values}" + end + allowable_values = ["email", "status", "verified", "review_type", "created", "updated", "images", "product", "product.url", "product.name", "product.image_url", "rating", "author", "content", "title", "smart_quote", "public_reply", "public_reply.content", "public_reply.author", "public_reply.updated"] + if @api_client.config.client_side_validation && opts[:'fields_review'] && !opts[:'fields_review'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_review\", must include one of #{allowable_values}" + end + allowable_values = ["events"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ReviewsApi.get_reviews, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ReviewsApi.get_reviews, must be greater than or equal to 1.' + end + + allowable_values = ["created", "-created", "rating", "-rating", "updated", "-updated"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/reviews' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[event]'] = @api_client.build_collection_param(opts[:'fields_event'], :csv) if !opts[:'fields_event'].nil? + query_params[:'fields[review]'] = @api_client.build_collection_param(opts[:'fields_review'], :csv) if !opts[:'fields_review'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"ReviewsApi.get_reviews", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReviewsApi#get_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/klaviyo-api-sdk/api/segments_api.rb b/lib/klaviyo-api-sdk/api/segments_api.rb index 2def003..63d24e0 100644 --- a/lib/klaviyo-api-sdk/api/segments_api.rb +++ b/lib/klaviyo-api-sdk/api/segments_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -43,7 +43,7 @@ def create_segment_with_http_info(segment_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'segment_create_query' when calling SegmentsApi.create_segment" end # resource path - local_var_path = '/api/segments/' + local_var_path = '/api/segments' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +51,11 @@ def create_segment_with_http_info(segment_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -113,7 +113,7 @@ def delete_segment_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.delete_segment" end # resource path - local_var_path = '/api/segments/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -121,9 +121,9 @@ def delete_segment_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -154,69 +154,68 @@ def delete_segment_with_http_info(id, opts = {}) return data, status_code, headers end - # Get Segment - # Get a segment with the given segment ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[segment]=profile_count` parameter in your API request:
Burst: `1/s`
Steady: `15/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `segments:read` - # @param id [String] + # Get Profile IDs for Segment + # Get all profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for the given segment ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:read` `segments:read` + # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_segment(id, opts = {}) - data, _status_code, _headers = get_segment_with_http_info(id, opts) + def get_profile_ids_for_segment(id, opts = {}) + data, _status_code, _headers = get_profile_ids_for_segment_with_http_info(id, opts) data end - # Get Segment - # Get a segment with the given segment ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[segment]=profile_count` parameter in your API request:<br>Burst: `1/s`<br>Steady: `15/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-07-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `segments:read` - # @param id [String] + # alias of `get_profile_ids_for_segment` + alias get_segment_relationships_profiles get_profile_ids_for_segment + + # Get Profile IDs for Segment + # Get all profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for the given segment ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:read` `segments:read` + # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_segment_with_http_info(id, opts = {}) + def get_profile_ids_for_segment_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment ...' + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_profile_ids_for_segment ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment" + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_profile_ids_for_segment" end - allowable_values = ["profile_count"] - if @api_client.config.client_side_validation && opts[:'additional_fields_segment'] && !opts[:'additional_fields_segment'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"additional_fields_segment\", must include one of #{allowable_values}" - end - allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred", "profile_count"] - if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_profile_ids_for_segment, must be smaller than or equal to 1000.' end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_profile_ids_for_segment, must be greater than or equal to 1.' end - allowable_values = ["tags"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + + allowable_values = ["joined_group_at", "-joined_group_at"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/segments/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}/relationships/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'additional-fields[segment]'] = @api_client.build_collection_param(opts[:'additional_fields_segment'], :csv) if !opts[:'additional_fields_segment'].nil? - query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -231,7 +230,7 @@ def get_segment_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"SegmentsApi.get_segment", + :operation => :"SegmentsApi.get_profile_ids_for_segment", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -242,60 +241,66 @@ def get_segment_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SegmentsApi#get_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SegmentsApi#get_profile_ids_for_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Segment Profiles + # alias of `get_profile_ids_for_segment_with_http_info` + alias get_segment_relationships_profiles_with_http_info get_profile_ids_for_segment_with_http_info + + # Get Profiles for Segment # Get all profiles within a segment with the given segment ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, `push_token`, and `joined_group_at` fields. Profiles can be sorted by the following fields, in ascending and descending order: `joined_group_at`

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:read` `segments:read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_segment_profiles(id, opts = {}) - data, _status_code, _headers = get_segment_profiles_with_http_info(id, opts) + def get_profiles_for_segment(id, opts = {}) + data, _status_code, _headers = get_profiles_for_segment_with_http_info(id, opts) data end - # Get Segment Profiles + # alias of `get_profiles_for_segment` + alias get_segment_profiles get_profiles_for_segment + + # Get Profiles for Segment # Get all profiles within a segment with the given segment ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, `push_token`, and `joined_group_at` fields. Profiles can be sorted by the following fields, in ascending and descending order: `joined_group_at`<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:read` `segments:read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :additional_fields_profile Request additional fields not included by default in the response. Supported values: 'subscriptions', 'predictive_analytics' - # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination + # @option opts [Array] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_segment_profiles_with_http_info(id, opts = {}) + def get_profiles_for_segment_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_profiles ...' + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_profiles_for_segment ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_profiles" + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_profiles_for_segment" end allowable_values = ["subscriptions", "predictive_analytics"] if @api_client.config.client_side_validation && opts[:'additional_fields_profile'] && !opts[:'additional_fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"additional_fields_profile\", must include one of #{allowable_values}" end - allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "joined_group_at", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] + allowable_values = ["email", "phone_number", "external_id", "first_name", "last_name", "organization", "locale", "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", "location.ip", "properties", "joined_group_at", "subscriptions", "subscriptions.email", "subscriptions.email.marketing", "subscriptions.email.marketing.can_receive_email_marketing", "subscriptions.email.marketing.consent", "subscriptions.email.marketing.consent_timestamp", "subscriptions.email.marketing.last_updated", "subscriptions.email.marketing.method", "subscriptions.email.marketing.method_detail", "subscriptions.email.marketing.custom_method_detail", "subscriptions.email.marketing.double_optin", "subscriptions.email.marketing.suppression", "subscriptions.email.marketing.list_suppressions", "subscriptions.sms", "subscriptions.sms.marketing", "subscriptions.sms.marketing.can_receive_sms_marketing", "subscriptions.sms.marketing.consent", "subscriptions.sms.marketing.consent_timestamp", "subscriptions.sms.marketing.method", "subscriptions.sms.marketing.method_detail", "subscriptions.sms.marketing.last_updated", "subscriptions.sms.transactional", "subscriptions.sms.transactional.can_receive_sms_transactional", "subscriptions.sms.transactional.consent", "subscriptions.sms.transactional.consent_timestamp", "subscriptions.sms.transactional.method", "subscriptions.sms.transactional.method_detail", "subscriptions.sms.transactional.last_updated", "subscriptions.mobile_push", "subscriptions.mobile_push.marketing", "subscriptions.mobile_push.marketing.can_receive_push_marketing", "subscriptions.mobile_push.marketing.consent", "subscriptions.mobile_push.marketing.consent_timestamp", "predictive_analytics", "predictive_analytics.historic_clv", "predictive_analytics.predicted_clv", "predictive_analytics.total_clv", "predictive_analytics.historic_number_of_orders", "predictive_analytics.predicted_number_of_orders", "predictive_analytics.average_days_between_orders", "predictive_analytics.average_order_value", "predictive_analytics.churn_probability", "predictive_analytics.expected_date_of_next_order"] if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_segment_profiles, must be smaller than or equal to 100.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_profiles_for_segment, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_segment_profiles, must be greater than or equal to 1.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_profiles_for_segment, must be greater than or equal to 1.' end allowable_values = ["joined_group_at", "-joined_group_at"] @@ -303,7 +308,7 @@ def get_segment_profiles_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/segments/{id}/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}/profiles'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -317,9 +322,9 @@ def get_segment_profiles_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -334,7 +339,7 @@ def get_segment_profiles_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"SegmentsApi.get_segment_profiles", + :operation => :"SegmentsApi.get_profiles_for_segment", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -345,70 +350,84 @@ def get_segment_profiles_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SegmentsApi#get_segment_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SegmentsApi#get_profiles_for_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Segment Relationships Profiles - # Get all profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for the given segment ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `profiles:read` `segments:read` + # alias of `get_profiles_for_segment_with_http_info` + alias get_segment_profiles_with_http_info get_profiles_for_segment_with_http_info + + # Get Segment + # Get a segment with the given segment ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m`

Rate limits when using the `additional-fields[segment]=profile_count` parameter in your API request:
Burst: `1/s`
Steady: `15/m`

To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `segments:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] - def get_segment_relationships_profiles(id, opts = {}) - data, _status_code, _headers = get_segment_relationships_profiles_with_http_info(id, opts) + def get_segment(id, opts = {}) + data, _status_code, _headers = get_segment_with_http_info(id, opts) data end - # Get Segment Relationships Profiles - # Get all profile membership [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for the given segment ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `profiles:read` `segments:read` + # Get Segment + # Get a segment with the given segment ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`<br><br>Rate limits when using the `additional-fields[segment]=profile_count` parameter in your API request:<br>Burst: `1/s`<br>Steady: `15/m`<br><br>To learn more about how the `additional-fields` parameter impacts rate limits, check out our [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/v2024-10-15/docs/rate_limits_and_error_handling) guide. **Scopes:** `segments:read` # @param id [String] # @param [Hash] opts the optional parameters - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`, `equals`<br>`phone_number`: `any`, `equals`<br>`push_token`: `any`, `equals`<br>`_kx`: `equals`<br>`joined_group_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 1000. (default to 20) - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :additional_fields_segment Request additional fields not included by default in the response. Supported values: 'profile_count' + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_segment_relationships_profiles_with_http_info(id, opts = {}) + def get_segment_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_relationships_profiles ...' + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_relationships_profiles" + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment" end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_segment_relationships_profiles, must be smaller than or equal to 1000.' + allowable_values = ["profile_count"] + if @api_client.config.client_side_validation && opts[:'additional_fields_segment'] && !opts[:'additional_fields_segment'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"additional_fields_segment\", must include one of #{allowable_values}" end - - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SegmentsApi.get_segment_relationships_profiles, must be greater than or equal to 1.' + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" end - - allowable_values = ["joined_group_at", "-joined_group_at"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred", "profile_count"] + if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + end + allowable_values = ["flow-triggers", "tags"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/segments/{id}/relationships/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'additional-fields[segment]'] = @api_client.build_collection_param(opts[:'additional_fields_segment'], :csv) if !opts[:'additional_fields_segment'].nil? + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? + query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -423,7 +442,7 @@ def get_segment_relationships_profiles_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"SegmentsApi.get_segment_relationships_profiles", + :operation => :"SegmentsApi.get_segment", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -434,46 +453,53 @@ def get_segment_relationships_profiles_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SegmentsApi#get_segment_relationships_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SegmentsApi#get_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Segment Relationships Tags - # If `related_resource` is `tags`, returns the tag IDs of all tags associated with the given segment ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:read` `tags:read` - # @param id [String] + # Get Segment Flow Triggers + # Get all flows where the given segment ID is being used as the trigger.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `segments:read` + # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_segment_relationships_tags(id, opts = {}) - data, _status_code, _headers = get_segment_relationships_tags_with_http_info(id, opts) + def get_segment_flow_triggers(id, opts = {}) + data, _status_code, _headers = get_segment_flow_triggers_with_http_info(id, opts) data end - # Get Segment Relationships Tags - # If `related_resource` is `tags`, returns the tag IDs of all tags associated with the given segment ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:read` `tags:read` - # @param id [String] + # Get Segment Flow Triggers + # Get all flows where the given segment ID is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `segments:read` + # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo. # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_segment_relationships_tags_with_http_info(id, opts = {}) + def get_segment_flow_triggers_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_relationships_tags ...' + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_flow_triggers ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_relationships_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_flow_triggers" + end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/segments/{id}/relationships/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -488,7 +514,7 @@ def get_segment_relationships_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"SegmentsApi.get_segment_relationships_tags", + :operation => :"SegmentsApi.get_segment_flow_triggers", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -499,53 +525,46 @@ def get_segment_relationships_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SegmentsApi#get_segment_relationships_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SegmentsApi#get_segment_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Segment Tags - # Return all tags associated with the given segment ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:read` `tags:read` - # @param id [String] + # Get Segment Relationships Flow Triggers + # Get all flow [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) where the given segment is being used as the trigger.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `segments:read` + # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_segment_tags(id, opts = {}) - data, _status_code, _headers = get_segment_tags_with_http_info(id, opts) + def get_segment_relationships_flow_triggers(id, opts = {}) + data, _status_code, _headers = get_segment_relationships_flow_triggers_with_http_info(id, opts) data end - # Get Segment Tags - # Return all tags associated with the given segment ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:read` `tags:read` - # @param id [String] + # Get Segment Relationships Flow Triggers + # Get all flow [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) where the given segment is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `segments:read` + # @param id [String] Primary key that uniquely identifies this segment. Generated by Klaviyo. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_segment_tags_with_http_info(id, opts = {}) + def get_segment_relationships_flow_triggers_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_tags ...' + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segment_relationships_flow_triggers ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_tags" - end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_segment_relationships_flow_triggers" end # resource path - local_var_path = '/api/segments/{id}/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -560,7 +579,7 @@ def get_segment_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"SegmentsApi.get_segment_tags", + :operation => :"SegmentsApi.get_segment_relationships_flow_triggers", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -571,7 +590,7 @@ def get_segment_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SegmentsApi#get_segment_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SegmentsApi#get_segment_relationships_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -579,12 +598,13 @@ def get_segment_tags_with_http_info(id, opts = {}) # Get Segments # Get all segments in an account. Filter to request a subset of all segments. Segments can be filtered by `name`, `created`, and `updated` fields. Returns a maximum of 10 results per page.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `segments:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_segments(opts = {}) data, _status_code, _headers = get_segments_with_http_info(opts) @@ -594,17 +614,22 @@ def get_segments(opts = {}) # Get Segments # Get all segments in an account. Filter to request a subset of all segments. Segments can be filtered by `name`, `created`, and `updated` fields. Returns a maximum of 10 results per page.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `segments:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`<br>`is_active`: `any`, `equals`<br>`is_starred`: `equals` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_segments_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SegmentsApi.get_segments ...' end + allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"] + if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}" + end allowable_values = ["name", "definition", "definition.condition_groups", "created", "updated", "is_active", "is_processing", "is_starred"] if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" @@ -613,7 +638,7 @@ def get_segments_with_http_info(opts = {}) if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end - allowable_values = ["tags"] + allowable_values = ["flow-triggers", "tags"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end @@ -622,10 +647,11 @@ def get_segments_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/segments/' + local_var_path = '/api/segments' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil? query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? @@ -636,9 +662,9 @@ def get_segments_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -669,6 +695,155 @@ def get_segments_with_http_info(opts = {}) return data, status_code, headers end + # Get Tag IDs for Segment + # If `related_resource` is `tags`, returns the tag IDs of all tags associated with the given segment ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:read` `tags:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_tag_ids_for_segment(id, opts = {}) + data, _status_code, _headers = get_tag_ids_for_segment_with_http_info(id, opts) + data + end + + # alias of `get_tag_ids_for_segment` + alias get_segment_relationships_tags get_tag_ids_for_segment + + # Get Tag IDs for Segment + # If `related_resource` is `tags`, returns the tag IDs of all tags associated with the given segment ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:read` `tags:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tag_ids_for_segment_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_tag_ids_for_segment ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_tag_ids_for_segment" + end + # resource path + local_var_path = '/api/segments/{id}/relationships/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"SegmentsApi.get_tag_ids_for_segment", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SegmentsApi#get_tag_ids_for_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_tag_ids_for_segment_with_http_info` + alias get_segment_relationships_tags_with_http_info get_tag_ids_for_segment_with_http_info + + # Get Tags for Segment + # Return all tags associated with the given segment ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:read` `tags:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_tags_for_segment(id, opts = {}) + data, _status_code, _headers = get_tags_for_segment_with_http_info(id, opts) + data + end + + # alias of `get_tags_for_segment` + alias get_segment_tags get_tags_for_segment + + # Get Tags for Segment + # Return all tags associated with the given segment ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:read` `tags:read` + # @param id [String] + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tags_for_segment_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SegmentsApi.get_tags_for_segment ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling SegmentsApi.get_tags_for_segment" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/segments/{id}/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"SegmentsApi.get_tags_for_segment", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SegmentsApi#get_tags_for_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_tags_for_segment_with_http_info` + alias get_segment_tags_with_http_info get_tags_for_segment_with_http_info + # Update Segment # Update a segment with the given segment ID.

*Rate limits*:
Burst: `1/s`
Steady: `15/m`
Daily: `100/d` **Scopes:** `segments:write` # @param id [String] @@ -699,7 +874,7 @@ def update_segment_with_http_info(id, segment_partial_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'segment_partial_update_query' when calling SegmentsApi.update_segment" end # resource path - local_var_path = '/api/segments/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/segments/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -707,11 +882,11 @@ def update_segment_with_http_info(id, segment_partial_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/tags_api.rb b/lib/klaviyo-api-sdk/api/tags_api.rb index 9a7dde4..e7b25a7 100644 --- a/lib/klaviyo-api-sdk/api/tags_api.rb +++ b/lib/klaviyo-api-sdk/api/tags_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -43,7 +43,7 @@ def create_tag_with_http_info(tag_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'tag_create_query' when calling TagsApi.create_tag" end # resource path - local_var_path = '/api/tags/' + local_var_path = '/api/tags' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +51,11 @@ def create_tag_with_http_info(tag_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -113,7 +113,7 @@ def create_tag_group_with_http_info(tag_group_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'tag_group_create_query' when calling TagsApi.create_tag_group" end # resource path - local_var_path = '/api/tag-groups/' + local_var_path = '/api/tag-groups' # query parameters query_params = opts[:query_params] || {} @@ -121,11 +121,11 @@ def create_tag_group_with_http_info(tag_group_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -159,40 +159,31 @@ def create_tag_group_with_http_info(tag_group_create_query, opts = {}) return data, status_code, headers end - # Create Tag Relationships Campaigns - # Associate a tag with one or more campaigns. Any campaign cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the campaign(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` - # @param id [String] - # @param tag_campaign_op [TagCampaignOp] + # Delete Tag + # Delete the tag with the given tag ID. Any associations between the tag and other resources will also be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` `tags:write` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters # @return [nil] - def create_tag_relationships_campaigns(id, tag_campaign_op, opts = {}) - create_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts) + def delete_tag(id, opts = {}) + delete_tag_with_http_info(id, opts) nil end - # alias of `create_tag_relationships_campaigns` - alias create_tag_relationships_campaign create_tag_relationships_campaigns - - # Create Tag Relationships Campaigns - # Associate a tag with one or more campaigns. Any campaign cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the campaign(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` - # @param id [String] - # @param tag_campaign_op [TagCampaignOp] + # Delete Tag + # Delete the tag with the given tag ID. Any associations between the tag and other resources will also be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` `tags:write` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts = {}) + def delete_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.create_tag_relationships_campaigns ...' + @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.create_tag_relationships_campaigns" - end - # verify the required parameter 'tag_campaign_op' is set - if @api_client.config.client_side_validation && tag_campaign_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_campaign_op' when calling TagsApi.create_tag_relationships_campaigns" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag" end # resource path - local_var_path = '/api/tags/{id}/relationships/campaigns/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -200,20 +191,15 @@ def create_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_campaign_op) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] @@ -222,7 +208,7 @@ def create_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.create_tag_relationships_campaigns", + :operation => :"TagsApi.delete_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -231,50 +217,38 @@ def create_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#create_tag_relationships_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `create_tag_relationships_campaigns_with_http_info` - alias create_tag_relationships_campaign_with_http_info create_tag_relationships_campaigns_with_http_info - - # Create Tag Relationships Flows - # Associate a tag with one or more flows. Any flow cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the flow(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:write` `tags:write` - # @param id [String] - # @param tag_flow_op [TagFlowOp] + # Delete Tag Group + # Delete the tag group with the given tag group ID. Any tags inside that tag group, and any associations between those tags and other resources, will also be removed. The default tag group cannot be deleted.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` `tags:write` + # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @return [nil] - def create_tag_relationships_flows(id, tag_flow_op, opts = {}) - create_tag_relationships_flows_with_http_info(id, tag_flow_op, opts) - nil + # @return [Hash] + def delete_tag_group(id, opts = {}) + data, _status_code, _headers = delete_tag_group_with_http_info(id, opts) + data end - # alias of `create_tag_relationships_flows` - alias create_tag_relationships_flow create_tag_relationships_flows - - # Create Tag Relationships Flows - # Associate a tag with one or more flows. Any flow cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the flow(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:write` `tags:write` - # @param id [String] - # @param tag_flow_op [TagFlowOp] + # Delete Tag Group + # Delete the tag group with the given tag group ID. Any tags inside that tag group, and any associations between those tags and other resources, will also be removed. The default tag group cannot be deleted.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` `tags:write` + # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_tag_relationships_flows_with_http_info(id, tag_flow_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def delete_tag_group_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.create_tag_relationships_flows ...' + @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag_group ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.create_tag_relationships_flows" - end - # verify the required parameter 'tag_flow_op' is set - if @api_client.config.client_side_validation && tag_flow_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_flow_op' when calling TagsApi.create_tag_relationships_flows" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag_group" end # resource path - local_var_path = '/api/tags/{id}/relationships/flows/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tag-groups/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -282,29 +256,24 @@ def create_tag_relationships_flows_with_http_info(id, tag_flow_op, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_flow_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.create_tag_relationships_flows", + :operation => :"TagsApi.delete_tag_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -313,50 +282,41 @@ def create_tag_relationships_flows_with_http_info(id, tag_flow_op, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#create_tag_relationships_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#delete_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `create_tag_relationships_flows_with_http_info` - alias create_tag_relationships_flow_with_http_info create_tag_relationships_flows_with_http_info - - # Create Tag Relationships Lists - # Associate a tag with one or more lists. Any list cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the lists(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:write` `tags:write` - # @param id [String] - # @param tag_list_op [TagListOp] + # Get Campaign IDs for Tag + # Returns the IDs of all campaigns associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [nil] - def create_tag_relationships_lists(id, tag_list_op, opts = {}) - create_tag_relationships_lists_with_http_info(id, tag_list_op, opts) - nil + # @return [Hash] + def get_campaign_ids_for_tag(id, opts = {}) + data, _status_code, _headers = get_campaign_ids_for_tag_with_http_info(id, opts) + data end - # alias of `create_tag_relationships_lists` - alias create_tag_relationships_list create_tag_relationships_lists + # alias of `get_campaign_ids_for_tag` + alias get_tag_relationships_campaigns get_campaign_ids_for_tag - # Create Tag Relationships Lists - # Associate a tag with one or more lists. Any list cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the lists(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:write` `tags:write` - # @param id [String] - # @param tag_list_op [TagListOp] + # Get Campaign IDs for Tag + # Returns the IDs of all campaigns associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_tag_relationships_lists_with_http_info(id, tag_list_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_campaign_ids_for_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.create_tag_relationships_lists ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_campaign_ids_for_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.create_tag_relationships_lists" - end - # verify the required parameter 'tag_list_op' is set - if @api_client.config.client_side_validation && tag_list_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_list_op' when calling TagsApi.create_tag_relationships_lists" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_campaign_ids_for_tag" end # resource path - local_var_path = '/api/tags/{id}/relationships/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/campaigns'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -364,29 +324,24 @@ def create_tag_relationships_lists_with_http_info(id, tag_list_op, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_list_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.create_tag_relationships_lists", + :operation => :"TagsApi.get_campaign_ids_for_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -395,50 +350,44 @@ def create_tag_relationships_lists_with_http_info(id, tag_list_op, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#create_tag_relationships_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_campaign_ids_for_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `create_tag_relationships_lists_with_http_info` - alias create_tag_relationships_list_with_http_info create_tag_relationships_lists_with_http_info + # alias of `get_campaign_ids_for_tag_with_http_info` + alias get_tag_relationships_campaigns_with_http_info get_campaign_ids_for_tag_with_http_info - # Create Tag Relationships Segments - # Associate a tag with one or more segments. Any segment cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the segments(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:write` `tags:write` - # @param id [String] - # @param tag_segment_op [TagSegmentOp] + # Get Flow IDs for Tag + # Returns the IDs of all flows associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [nil] - def create_tag_relationships_segments(id, tag_segment_op, opts = {}) - create_tag_relationships_segments_with_http_info(id, tag_segment_op, opts) - nil + # @return [Hash] + def get_flow_ids_for_tag(id, opts = {}) + data, _status_code, _headers = get_flow_ids_for_tag_with_http_info(id, opts) + data end - # alias of `create_tag_relationships_segments` - alias create_tag_relationships_segment create_tag_relationships_segments + # alias of `get_flow_ids_for_tag` + alias get_tag_relationships_flows get_flow_ids_for_tag - # Create Tag Relationships Segments - # Associate a tag with one or more segments. Any segment cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the segments(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:write` `tags:write` - # @param id [String] - # @param tag_segment_op [TagSegmentOp] + # Get Flow IDs for Tag + # Returns the IDs of all flows associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_tag_relationships_segments_with_http_info(id, tag_segment_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_flow_ids_for_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.create_tag_relationships_segments ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_flow_ids_for_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.create_tag_relationships_segments" - end - # verify the required parameter 'tag_segment_op' is set - if @api_client.config.client_side_validation && tag_segment_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_segment_op' when calling TagsApi.create_tag_relationships_segments" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_flow_ids_for_tag" end # resource path - local_var_path = '/api/tags/{id}/relationships/segments/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/flows'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -446,29 +395,24 @@ def create_tag_relationships_segments_with_http_info(id, tag_segment_op, opts = # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_segment_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.create_tag_relationships_segments", + :operation => :"TagsApi.get_flow_ids_for_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -477,41 +421,44 @@ def create_tag_relationships_segments_with_http_info(id, tag_segment_op, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#create_tag_relationships_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_flow_ids_for_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # alias of `create_tag_relationships_segments_with_http_info` - alias create_tag_relationships_segment_with_http_info create_tag_relationships_segments_with_http_info + # alias of `get_flow_ids_for_tag_with_http_info` + alias get_tag_relationships_flows_with_http_info get_flow_ids_for_tag_with_http_info - # Delete Tag - # Delete the tag with the given tag ID. Any associations between the tag and other resources will also be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` `tags:write` + # Get List IDs for Tag + # Returns the IDs of all lists associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `tags:read` # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [nil] - def delete_tag(id, opts = {}) - delete_tag_with_http_info(id, opts) - nil + # @return [Hash] + def get_list_ids_for_tag(id, opts = {}) + data, _status_code, _headers = get_list_ids_for_tag_with_http_info(id, opts) + data end - # Delete Tag - # Delete the tag with the given tag ID. Any associations between the tag and other resources will also be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` `tags:write` + # alias of `get_list_ids_for_tag` + alias get_tag_relationships_lists get_list_ids_for_tag + + # Get List IDs for Tag + # Returns the IDs of all lists associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `tags:read` # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tag_with_http_info(id, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_list_ids_for_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_list_ids_for_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_list_ids_for_tag" end # resource path - local_var_path = '/api/tags/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -519,9 +466,9 @@ def delete_tag_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -530,13 +477,13 @@ def delete_tag_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.delete_tag", + :operation => :"TagsApi.get_list_ids_for_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -545,38 +492,44 @@ def delete_tag_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_list_ids_for_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Tag Group - # Delete the tag group with the given tag group ID. Any tags inside that tag group, and any associations between those tags and other resources, will also be removed. The default tag group cannot be deleted.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` `tags:write` - # @param id [String] The Tag Group ID + # alias of `get_list_ids_for_tag_with_http_info` + alias get_tag_relationships_lists_with_http_info get_list_ids_for_tag_with_http_info + + # Get Segment IDs for Tag + # Returns the IDs of all segments associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:read` `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters # @return [Hash] - def delete_tag_group(id, opts = {}) - data, _status_code, _headers = delete_tag_group_with_http_info(id, opts) + def get_segment_ids_for_tag(id, opts = {}) + data, _status_code, _headers = get_segment_ids_for_tag_with_http_info(id, opts) data end - # Delete Tag Group - # Delete the tag group with the given tag group ID. Any tags inside that tag group, and any associations between those tags and other resources, will also be removed. The default tag group cannot be deleted.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` `tags:write` - # @param id [String] The Tag Group ID + # alias of `get_segment_ids_for_tag` + alias get_tag_relationships_segments get_segment_ids_for_tag + + # Get Segment IDs for Tag + # Returns the IDs of all segments associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:read` `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def delete_tag_group_with_http_info(id, opts = {}) + def get_segment_ids_for_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag_group ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_segment_ids_for_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag_group" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_segment_ids_for_tag" end # resource path - local_var_path = '/api/tag-groups/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -584,9 +537,9 @@ def delete_tag_group_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -601,7 +554,7 @@ def delete_tag_group_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.delete_tag_group", + :operation => :"TagsApi.get_segment_ids_for_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -610,74 +563,87 @@ def delete_tag_group_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#delete_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_segment_ids_for_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Tag Relationships Campaigns - # Remove a tag's association with one or more campaigns. Use the request body to pass in the ID(s) of the campaign(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` - # @param id [String] - # @param tag_campaign_op [TagCampaignOp] + # alias of `get_segment_ids_for_tag_with_http_info` + alias get_tag_relationships_segments_with_http_info get_segment_ids_for_tag_with_http_info + + # Get Tag + # Retrieve the tag with the given tag ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [nil] - def delete_tag_relationships_campaigns(id, tag_campaign_op, opts = {}) - delete_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts) - nil + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @return [Hash] + def get_tag(id, opts = {}) + data, _status_code, _headers = get_tag_with_http_info(id, opts) + data end - # Delete Tag Relationships Campaigns - # Remove a tag's association with one or more campaigns. Use the request body to pass in the ID(s) of the campaign(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` - # @param id [String] - # @param tag_campaign_op [TagCampaignOp] + # Get Tag + # Retrieve the tag with the given tag ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts = {}) + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag_relationships_campaigns ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag_relationships_campaigns" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag" end - # verify the required parameter 'tag_campaign_op' is set - if @api_client.config.client_side_validation && tag_campaign_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_campaign_op' when calling TagsApi.delete_tag_relationships_campaigns" + allowable_values = ["name", "exclusive", "default"] + if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + end + allowable_values = ["tag-group"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/tags/{id}/relationships/campaigns/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_campaign_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.delete_tag_relationships_campaigns", + :operation => :"TagsApi.get_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -686,74 +652,70 @@ def delete_tag_relationships_campaigns_with_http_info(id, tag_campaign_op, opts :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#delete_tag_relationships_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Tag Relationships Flows - # Remove a tag's association with one or more flows. Use the request body to pass in the ID(s) of the flows(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:write` `tags:write` - # @param id [String] - # @param tag_flow_op [TagFlowOp] + # Get Tag Group + # Retrieve the tag group with the given tag group ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @return [nil] - def delete_tag_relationships_flows(id, tag_flow_op, opts = {}) - delete_tag_relationships_flows_with_http_info(id, tag_flow_op, opts) - nil + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_tag_group(id, opts = {}) + data, _status_code, _headers = get_tag_group_with_http_info(id, opts) + data end - # Delete Tag Relationships Flows - # Remove a tag's association with one or more flows. Use the request body to pass in the ID(s) of the flows(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:write` `tags:write` - # @param id [String] - # @param tag_flow_op [TagFlowOp] + # Get Tag Group + # Retrieve the tag group with the given tag group ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tag_relationships_flows_with_http_info(id, tag_flow_op, opts = {}) + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tag_group_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag_relationships_flows ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_group ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag_relationships_flows" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_group" end - # verify the required parameter 'tag_flow_op' is set - if @api_client.config.client_side_validation && tag_flow_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_flow_op' when calling TagsApi.delete_tag_relationships_flows" + allowable_values = ["name", "exclusive", "default"] + if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/tags/{id}/relationships/flows/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tag-groups/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_flow_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.delete_tag_relationships_flows", + :operation => :"TagsApi.get_tag_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -762,74 +724,73 @@ def delete_tag_relationships_flows_with_http_info(id, tag_flow_op, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#delete_tag_relationships_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Tag Relationships Lists - # Remove a tag's association with one or more lists. Use the request body to pass in the ID(s) of the list(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:write` `tags:write` - # @param id [String] - # @param tag_list_op [TagListOp] + # Get Tag Group for Tag + # Returns the tag group resource for a given tag ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [nil] - def delete_tag_relationships_lists(id, tag_list_op, opts = {}) - delete_tag_relationships_lists_with_http_info(id, tag_list_op, opts) - nil + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_tag_group_for_tag(id, opts = {}) + data, _status_code, _headers = get_tag_group_for_tag_with_http_info(id, opts) + data end - # Delete Tag Relationships Lists - # Remove a tag's association with one or more lists. Use the request body to pass in the ID(s) of the list(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:write` `tags:write` - # @param id [String] - # @param tag_list_op [TagListOp] + # alias of `get_tag_group_for_tag` + alias get_tag_tag_group get_tag_group_for_tag + + # Get Tag Group for Tag + # Returns the tag group resource for a given tag ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tag_relationships_lists_with_http_info(id, tag_list_op, opts = {}) + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tag_group_for_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag_relationships_lists ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_group_for_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag_relationships_lists" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_group_for_tag" end - # verify the required parameter 'tag_list_op' is set - if @api_client.config.client_side_validation && tag_list_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_list_op' when calling TagsApi.delete_tag_relationships_lists" + allowable_values = ["name", "exclusive", "default"] + if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/tags/{id}/relationships/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/tag-group'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_list_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.delete_tag_relationships_lists", + :operation => :"TagsApi.get_tag_group_for_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -838,44 +799,44 @@ def delete_tag_relationships_lists_with_http_info(id, tag_list_op, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#delete_tag_relationships_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tag_group_for_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Tag Relationships Segments - # Remove a tag's association with one or more segments. Use the request body to pass in the ID(s) of the segments(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:write` `tags:write` - # @param id [String] - # @param tag_segment_op [TagSegmentOp] + # alias of `get_tag_group_for_tag_with_http_info` + alias get_tag_tag_group_with_http_info get_tag_group_for_tag_with_http_info + + # Get Tag Group ID for Tag + # Returns the id of the tag group related to the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [nil] - def delete_tag_relationships_segments(id, tag_segment_op, opts = {}) - delete_tag_relationships_segments_with_http_info(id, tag_segment_op, opts) - nil + # @return [Hash] + def get_tag_group_id_for_tag(id, opts = {}) + data, _status_code, _headers = get_tag_group_id_for_tag_with_http_info(id, opts) + data end - # Delete Tag Relationships Segments - # Remove a tag's association with one or more segments. Use the request body to pass in the ID(s) of the segments(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:write` `tags:write` - # @param id [String] - # @param tag_segment_op [TagSegmentOp] + # alias of `get_tag_group_id_for_tag` + alias get_tag_relationships_tag_group get_tag_group_id_for_tag + + # Get Tag Group ID for Tag + # Returns the id of the tag group related to the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # @param id [String] The Tag ID # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tag_relationships_segments_with_http_info(id, tag_segment_op, opts = {}) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tag_group_id_for_tag_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag_relationships_segments ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_group_id_for_tag ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.delete_tag_relationships_segments" - end - # verify the required parameter 'tag_segment_op' is set - if @api_client.config.client_side_validation && tag_segment_op.nil? - fail ArgumentError, "Missing the required parameter 'tag_segment_op' when calling TagsApi.delete_tag_relationships_segments" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_group_id_for_tag" end # resource path - local_var_path = '/api/tags/{id}/relationships/segments/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/tag-group'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -883,29 +844,24 @@ def delete_tag_relationships_segments_with_http_info(id, tag_segment_op, opts = # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_segment_op) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.delete_tag_relationships_segments", + :operation => :"TagsApi.get_tag_group_id_for_tag", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -914,69 +870,65 @@ def delete_tag_relationships_segments_with_http_info(id, tag_segment_op, opts = :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#delete_tag_relationships_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tag_group_id_for_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag - # Retrieve the tag with the given tag ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] The Tag ID + # alias of `get_tag_group_id_for_tag_with_http_info` + alias get_tag_relationships_tag_group_with_http_info get_tag_group_id_for_tag_with_http_info + + # Get Tag Groups + # List all tag groups in an account. Every account has one default tag group. Tag groups can be filtered by `name`, `exclusive`, and `default`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 25 tag groups per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_tag(id, opts = {}) - data, _status_code, _headers = get_tag_with_http_info(id, opts) + def get_tag_groups(opts = {}) + data, _status_code, _headers = get_tag_groups_with_http_info(opts) data end - # Get Tag - # Retrieve the tag with the given tag ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] The Tag ID + # Get Tag Groups + # List all tag groups in an account. Every account has one default tag group. Tag groups can be filtered by `name`, `exclusive`, and `default`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 25 tag groups per request, 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: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_with_http_info(id, opts = {}) + def get_tag_groups_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag ...' - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag" + @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_groups ...' end allowable_values = ["name", "exclusive", "default"] if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" - end - allowable_values = ["tag-group"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + allowable_values = ["id", "-id", "name", "-name"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/tags/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tag-groups' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -991,7 +943,7 @@ def get_tag_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag", + :operation => :"TagsApi.get_tag_groups", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1002,53 +954,49 @@ def get_tag_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tag_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Group - # Retrieve the tag group with the given tag group ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # Get Tag IDs for Tag Group + # Returns the tag IDs of all tags inside the given tag group.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_tag_group(id, opts = {}) - data, _status_code, _headers = get_tag_group_with_http_info(id, opts) + def get_tag_ids_for_tag_group(id, opts = {}) + data, _status_code, _headers = get_tag_ids_for_tag_group_with_http_info(id, opts) data end - # Get Tag Group - # Retrieve the tag group with the given tag group ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # alias of `get_tag_ids_for_tag_group` + alias get_tag_group_relationships_tags get_tag_ids_for_tag_group + + # Get Tag IDs for Tag Group + # Returns the tag IDs of all tags inside the given tag group.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_group_with_http_info(id, opts = {}) + def get_tag_ids_for_tag_group_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_group ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_ids_for_tag_group ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_group" - end - allowable_values = ["name", "exclusive", "default"] - if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_ids_for_tag_group" end # resource path - local_var_path = '/api/tag-groups/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tag-groups/{id}/relationships/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1063,7 +1011,7 @@ def get_tag_group_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_group", + :operation => :"TagsApi.get_tag_ids_for_tag_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1074,46 +1022,77 @@ def get_tag_group_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tag_ids_for_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Group Relationships Tags - # Returns the tag IDs of all tags inside the given tag group.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # alias of `get_tag_ids_for_tag_group_with_http_info` + alias get_tag_group_relationships_tags_with_http_info get_tag_ids_for_tag_group_with_http_info + + # Get Tags + # List all tags in an account. Tags can be filtered by `name`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 50 tags per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] - def get_tag_group_relationships_tags(id, opts = {}) - data, _status_code, _headers = get_tag_group_relationships_tags_with_http_info(id, opts) + def get_tags(opts = {}) + data, _status_code, _headers = get_tags_with_http_info(opts) data end - # Get Tag Group Relationships Tags - # Returns the tag IDs of all tags inside the given tag group.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # Get Tags + # List all tags in an account. Tags can be filtered by `name`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 50 tags per request, 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: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_group_relationships_tags_with_http_info(id, opts = {}) + def get_tags_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_group_relationships_tags ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tags ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_group_relationships_tags" + allowable_values = ["name", "exclusive", "default"] + if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" + end + allowable_values = ["name"] + if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" + end + allowable_values = ["tag-group"] + if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + end + allowable_values = ["id", "-id", "name", "-name"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/tag-groups/{id}/relationships/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags' # query parameters query_params = opts[:query_params] || {} + query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? + query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1128,7 +1107,7 @@ def get_tag_group_relationships_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_group_relationships_tags", + :operation => :"TagsApi.get_tags", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1139,42 +1118,45 @@ def get_tag_group_relationships_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_group_relationships_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Group Tags + # Get Tags for Tag Group # Return the tags for a given tag group ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] - def get_tag_group_tags(id, opts = {}) - data, _status_code, _headers = get_tag_group_tags_with_http_info(id, opts) + def get_tags_for_tag_group(id, opts = {}) + data, _status_code, _headers = get_tags_for_tag_group_with_http_info(id, opts) data end - # Get Tag Group Tags + # alias of `get_tags_for_tag_group` + alias get_tag_group_tags get_tags_for_tag_group + + # Get Tags for Tag Group # Return the tags for a given tag group ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # @param id [String] The Tag Group ID # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_group_tags_with_http_info(id, opts = {}) + def get_tags_for_tag_group_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_group_tags ...' + @api_client.config.logger.debug 'Calling API: TagsApi.get_tags_for_tag_group ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_group_tags" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tags_for_tag_group" end allowable_values = ["name"] if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/tag-groups/{id}/tags/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tag-groups/{id}/tags'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1183,9 +1165,9 @@ def get_tag_group_tags_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -1200,7 +1182,7 @@ def get_tag_group_tags_with_http_info(id, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_group_tags", + :operation => :"TagsApi.get_tags_for_tag_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1211,75 +1193,78 @@ def get_tag_group_tags_with_http_info(id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_group_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#get_tags_for_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Groups - # List all tag groups in an account. Every account has one default tag group. Tag groups can be filtered by `name`, `exclusive`, and `default`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 25 tag groups per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # alias of `get_tags_for_tag_group_with_http_info` + alias get_tag_group_tags_with_http_info get_tags_for_tag_group_with_http_info + + # Remove Tag from Campaigns + # Remove a tag's association with one or more campaigns. Use the request body to pass in the ID(s) of the campaign(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_campaign_op [TagCampaignOp] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Hash] - def get_tag_groups(opts = {}) - data, _status_code, _headers = get_tag_groups_with_http_info(opts) - data + # @return [nil] + def remove_tag_from_campaigns(id, tag_campaign_op, opts = {}) + remove_tag_from_campaigns_with_http_info(id, tag_campaign_op, opts) + nil end - # Get Tag Groups - # List all tag groups in an account. Every account has one default tag group. Tag groups can be filtered by `name`, `exclusive`, and `default`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 25 tag groups per request, 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: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # alias of `remove_tag_from_campaigns` + alias delete_tag_relationships_campaigns remove_tag_from_campaigns + + # Remove Tag from Campaigns + # Remove a tag's association with one or more campaigns. Use the request body to pass in the ID(s) of the campaign(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_campaign_op [TagCampaignOp] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`exclusive`: `equals`<br>`default`: `equals` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_groups_with_http_info(opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_tag_from_campaigns_with_http_info(id, tag_campaign_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_groups ...' + @api_client.config.logger.debug 'Calling API: TagsApi.remove_tag_from_campaigns ...' end - allowable_values = ["name", "exclusive", "default"] - if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.remove_tag_from_campaigns" end - allowable_values = ["id", "-id", "name", "-name"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'tag_campaign_op' is set + if @api_client.config.client_side_validation && tag_campaign_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_campaign_op' when calling TagsApi.remove_tag_from_campaigns" end # resource path - local_var_path = '/api/tag-groups/' + local_var_path = '/api/tags/{id}/relationships/campaigns'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_campaign_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_groups", + :operation => :"TagsApi.remove_tag_from_campaigns", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1288,38 +1273,50 @@ def get_tag_groups_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#remove_tag_from_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Relationships Campaigns - # Returns the IDs of all campaigns associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_campaigns_with_http_info` + alias delete_tag_relationships_campaigns_with_http_info remove_tag_from_campaigns_with_http_info + + # Remove Tag from Flows + # Remove a tag's association with one or more flows. Use the request body to pass in the ID(s) of the flows(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_flow_op [TagFlowOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def get_tag_relationships_campaigns(id, opts = {}) - data, _status_code, _headers = get_tag_relationships_campaigns_with_http_info(id, opts) - data + # @return [nil] + def remove_tag_from_flows(id, tag_flow_op, opts = {}) + remove_tag_from_flows_with_http_info(id, tag_flow_op, opts) + nil end - # Get Tag Relationships Campaigns - # Returns the IDs of all campaigns associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_flows` + alias delete_tag_relationships_flows remove_tag_from_flows + + # Remove Tag from Flows + # Remove a tag's association with one or more flows. Use the request body to pass in the ID(s) of the flows(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_flow_op [TagFlowOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_relationships_campaigns_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_tag_from_flows_with_http_info(id, tag_flow_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_relationships_campaigns ...' + @api_client.config.logger.debug 'Calling API: TagsApi.remove_tag_from_flows ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_relationships_campaigns" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.remove_tag_from_flows" + end + # verify the required parameter 'tag_flow_op' is set + if @api_client.config.client_side_validation && tag_flow_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_flow_op' when calling TagsApi.remove_tag_from_flows" end # resource path - local_var_path = '/api/tags/{id}/relationships/campaigns/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/flows'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1327,24 +1324,29 @@ def get_tag_relationships_campaigns_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_flow_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_relationships_campaigns", + :operation => :"TagsApi.remove_tag_from_flows", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1353,38 +1355,50 @@ def get_tag_relationships_campaigns_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_relationships_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#remove_tag_from_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Relationships Flows - # Returns the IDs of all flows associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_flows_with_http_info` + alias delete_tag_relationships_flows_with_http_info remove_tag_from_flows_with_http_info + + # Remove Tag from Lists + # Remove a tag's association with one or more lists. Use the request body to pass in the ID(s) of the list(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_list_op [TagListOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def get_tag_relationships_flows(id, opts = {}) - data, _status_code, _headers = get_tag_relationships_flows_with_http_info(id, opts) - data + # @return [nil] + def remove_tag_from_lists(id, tag_list_op, opts = {}) + remove_tag_from_lists_with_http_info(id, tag_list_op, opts) + nil end - # Get Tag Relationships Flows - # Returns the IDs of all flows associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_lists` + alias delete_tag_relationships_lists remove_tag_from_lists + + # Remove Tag from Lists + # Remove a tag's association with one or more lists. Use the request body to pass in the ID(s) of the list(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_list_op [TagListOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_relationships_flows_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_tag_from_lists_with_http_info(id, tag_list_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_relationships_flows ...' + @api_client.config.logger.debug 'Calling API: TagsApi.remove_tag_from_lists ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_relationships_flows" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.remove_tag_from_lists" + end + # verify the required parameter 'tag_list_op' is set + if @api_client.config.client_side_validation && tag_list_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_list_op' when calling TagsApi.remove_tag_from_lists" end # resource path - local_var_path = '/api/tags/{id}/relationships/flows/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1392,24 +1406,29 @@ def get_tag_relationships_flows_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_list_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_relationships_flows", + :operation => :"TagsApi.remove_tag_from_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1418,38 +1437,50 @@ def get_tag_relationships_flows_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_relationships_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#remove_tag_from_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Relationships Lists - # Returns the IDs of all lists associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_lists_with_http_info` + alias delete_tag_relationships_lists_with_http_info remove_tag_from_lists_with_http_info + + # Remove Tag from Segments + # Remove a tag's association with one or more segments. Use the request body to pass in the ID(s) of the segments(s) whose association with the tag will be removed.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_segment_op [TagSegmentOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def get_tag_relationships_lists(id, opts = {}) - data, _status_code, _headers = get_tag_relationships_lists_with_http_info(id, opts) - data + # @return [nil] + def remove_tag_from_segments(id, tag_segment_op, opts = {}) + remove_tag_from_segments_with_http_info(id, tag_segment_op, opts) + nil end - # Get Tag Relationships Lists - # Returns the IDs of all lists associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_segments` + alias delete_tag_relationships_segments remove_tag_from_segments + + # Remove Tag from Segments + # Remove a tag's association with one or more segments. Use the request body to pass in the ID(s) of the segments(s) whose association with the tag will be removed.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_segment_op [TagSegmentOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_relationships_lists_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_tag_from_segments_with_http_info(id, tag_segment_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_relationships_lists ...' + @api_client.config.logger.debug 'Calling API: TagsApi.remove_tag_from_segments ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_relationships_lists" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.remove_tag_from_segments" + end + # verify the required parameter 'tag_segment_op' is set + if @api_client.config.client_side_validation && tag_segment_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_segment_op' when calling TagsApi.remove_tag_from_segments" end # resource path - local_var_path = '/api/tags/{id}/relationships/lists/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1457,24 +1488,29 @@ def get_tag_relationships_lists_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_segment_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_relationships_lists", + :operation => :"TagsApi.remove_tag_from_segments", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1483,38 +1519,53 @@ def get_tag_relationships_lists_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_relationships_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#remove_tag_from_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Relationships Segments - # Returns the IDs of all segments associated with the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:read` `tags:read` - # @param id [String] + # alias of `remove_tag_from_segments_with_http_info` + alias delete_tag_relationships_segments_with_http_info remove_tag_from_segments_with_http_info + + # Tag Campaigns + # Associate a tag with one or more campaigns. Any campaign cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the campaign(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_campaign_op [TagCampaignOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def get_tag_relationships_segments(id, opts = {}) - data, _status_code, _headers = get_tag_relationships_segments_with_http_info(id, opts) - data + # @return [nil] + def tag_campaigns(id, tag_campaign_op, opts = {}) + tag_campaigns_with_http_info(id, tag_campaign_op, opts) + nil end - # Get Tag Relationships Segments - # Returns the IDs of all segments associated with the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:read` `tags:read` - # @param id [String] + # alias of `tag_campaigns` + alias create_tag_relationships_campaigns tag_campaigns + + # alias of `tag_campaigns` + alias create_tag_relationships_campaign tag_campaigns + + # Tag Campaigns + # Associate a tag with one or more campaigns. Any campaign cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the campaign(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `campaigns:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_campaign_op [TagCampaignOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_relationships_segments_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def tag_campaigns_with_http_info(id, tag_campaign_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_relationships_segments ...' + @api_client.config.logger.debug 'Calling API: TagsApi.tag_campaigns ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_relationships_segments" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.tag_campaigns" + end + # verify the required parameter 'tag_campaign_op' is set + if @api_client.config.client_side_validation && tag_campaign_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_campaign_op' when calling TagsApi.tag_campaigns" end # resource path - local_var_path = '/api/tags/{id}/relationships/segments/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/campaigns'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1522,24 +1573,29 @@ def get_tag_relationships_segments_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_campaign_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_relationships_segments", + :operation => :"TagsApi.tag_campaigns", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1548,38 +1604,56 @@ def get_tag_relationships_segments_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_relationships_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#tag_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Relationships Tag Group - # Returns the id of the tag group related to the given tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # alias of `tag_campaigns_with_http_info` + alias create_tag_relationships_campaigns_with_http_info tag_campaigns_with_http_info + + # alias of `tag_campaigns_with_http_info` + alias create_tag_relationships_campaign_with_http_info tag_campaigns_with_http_info + + # Tag Flows + # Associate a tag with one or more flows. Any flow cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the flow(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `flows:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_flow_op [TagFlowOp] # @param [Hash] opts the optional parameters - # @return [Hash] - def get_tag_relationships_tag_group(id, opts = {}) - data, _status_code, _headers = get_tag_relationships_tag_group_with_http_info(id, opts) - data + # @return [nil] + def tag_flows(id, tag_flow_op, opts = {}) + tag_flows_with_http_info(id, tag_flow_op, opts) + nil end - # Get Tag Relationships Tag Group - # Returns the id of the tag group related to the given tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # alias of `tag_flows` + alias create_tag_relationships_flows tag_flows + + # alias of `tag_flows` + alias create_tag_relationships_flow tag_flows + + # Tag Flows + # Associate a tag with one or more flows. Any flow cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the flow(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `flows:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_flow_op [TagFlowOp] # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_relationships_tag_group_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def tag_flows_with_http_info(id, tag_flow_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_relationships_tag_group ...' + @api_client.config.logger.debug 'Calling API: TagsApi.tag_flows ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_relationships_tag_group" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.tag_flows" + end + # verify the required parameter 'tag_flow_op' is set + if @api_client.config.client_side_validation && tag_flow_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_flow_op' when calling TagsApi.tag_flows" end # resource path - local_var_path = '/api/tags/{id}/relationships/tag-group/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/flows'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1587,24 +1661,29 @@ def get_tag_relationships_tag_group_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_flow_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_relationships_tag_group", + :operation => :"TagsApi.tag_flows", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1613,70 +1692,86 @@ def get_tag_relationships_tag_group_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_relationships_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#tag_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tag Tag Group - # Returns the tag group resource for a given tag ID.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # alias of `tag_flows_with_http_info` + alias create_tag_relationships_flows_with_http_info tag_flows_with_http_info + + # alias of `tag_flows_with_http_info` + alias create_tag_relationships_flow_with_http_info tag_flows_with_http_info + + # Tag Lists + # Associate a tag with one or more lists. Any list cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the lists(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `lists:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_list_op [TagListOp] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @return [Hash] - def get_tag_tag_group(id, opts = {}) - data, _status_code, _headers = get_tag_tag_group_with_http_info(id, opts) - data + # @return [nil] + def tag_lists(id, tag_list_op, opts = {}) + tag_lists_with_http_info(id, tag_list_op, opts) + nil end - # Get Tag Tag Group - # Returns the tag group resource for a given tag ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` - # @param id [String] + # alias of `tag_lists` + alias create_tag_relationships_lists tag_lists + + # alias of `tag_lists` + alias create_tag_relationships_list tag_lists + + # Tag Lists + # Associate a tag with one or more lists. Any list cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the lists(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `lists:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_list_op [TagListOp] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tag_tag_group_with_http_info(id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def tag_lists_with_http_info(id, tag_list_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tag_tag_group ...' + @api_client.config.logger.debug 'Calling API: TagsApi.tag_lists ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.get_tag_tag_group" + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.tag_lists" end - allowable_values = ["name", "exclusive", "default"] - if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" + # verify the required parameter 'tag_list_op' is set + if @api_client.config.client_side_validation && tag_list_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_list_op' when calling TagsApi.tag_lists" end # resource path - local_var_path = '/api/tags/{id}/tag-group/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}/relationships/lists'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_list_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tag_tag_group", + :operation => :"TagsApi.tag_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1685,91 +1780,86 @@ def get_tag_tag_group_with_http_info(id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tag_tag_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#tag_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get Tags - # List all tags in an account. Tags can be filtered by `name`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 50 tags per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` + # alias of `tag_lists_with_http_info` + alias create_tag_relationships_lists_with_http_info tag_lists_with_http_info + + # alias of `tag_lists_with_http_info` + alias create_tag_relationships_list_with_http_info tag_lists_with_http_info + + # Tag Segments + # Associate a tag with one or more segments. Any segment cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the segments(s) that will be associated with the tag.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `segments:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_segment_op [TagSegmentOp] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Hash] - def get_tags(opts = {}) - data, _status_code, _headers = get_tags_with_http_info(opts) - data + # @return [nil] + def tag_segments(id, tag_segment_op, opts = {}) + tag_segments_with_http_info(id, tag_segment_op, opts) + nil end - # Get Tags - # List all tags in an account. Tags can be filtered by `name`, and sorted by `name` or `id` in ascending or descending order. Returns a maximum of 50 tags per request, 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: `3/s`<br>Steady: `60/m` **Scopes:** `tags:read` + # alias of `tag_segments` + alias create_tag_relationships_segments tag_segments + + # alias of `tag_segments` + alias create_tag_relationships_segment tag_segments + + # Tag Segments + # Associate a tag with one or more segments. Any segment cannot be associated with more than **100** tags. Use the request body to pass in the ID(s) of the segments(s) that will be associated with the tag.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `segments:write` `tags:write` + # @param id [String] The Tag ID + # @param tag_segment_op [TagSegmentOp] # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_tag_group For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with` - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_tags_with_http_info(opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def tag_segments_with_http_info(id, tag_segment_op, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagsApi.get_tags ...' - end - allowable_values = ["name", "exclusive", "default"] - if @api_client.config.client_side_validation && opts[:'fields_tag_group'] && !opts[:'fields_tag_group'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag_group\", must include one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: TagsApi.tag_segments ...' end - allowable_values = ["name"] - if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}" - end - allowable_values = ["tag-group"] - if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TagsApi.tag_segments" end - allowable_values = ["id", "-id", "name", "-name"] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'tag_segment_op' is set + if @api_client.config.client_side_validation && tag_segment_op.nil? + fail ArgumentError, "Missing the required parameter 'tag_segment_op' when calling TagsApi.tag_segments" end # resource path - local_var_path = '/api/tags/' + local_var_path = '/api/tags/{id}/relationships/segments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'fields[tag-group]'] = @api_client.build_collection_param(opts[:'fields_tag_group'], :csv) if !opts[:'fields_tag_group'].nil? - query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil? - query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? - query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_segment_op) # return_type - return_type = opts[:debug_return_type] || 'Hash' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TagsApi.get_tags", + :operation => :"TagsApi.tag_segments", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1778,13 +1868,19 @@ def get_tags_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagsApi#get_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagsApi#tag_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `tag_segments_with_http_info` + alias create_tag_relationships_segments_with_http_info tag_segments_with_http_info + + # alias of `tag_segments_with_http_info` + alias create_tag_relationships_segment_with_http_info tag_segments_with_http_info + # Update Tag # Update the tag with the given tag ID. Only a tag's `name` can be changed. A tag cannot be moved from one tag group to another.

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `tags:read` `tags:write` # @param id [String] The Tag ID @@ -1815,7 +1911,7 @@ def update_tag_with_http_info(id, tag_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'tag_update_query' when calling TagsApi.update_tag" end # resource path - local_var_path = '/api/tags/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tags/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1823,11 +1919,11 @@ def update_tag_with_http_info(id, tag_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -1891,7 +1987,7 @@ def update_tag_group_with_http_info(id, tag_group_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'tag_group_update_query' when calling TagsApi.update_tag_group" end # resource path - local_var_path = '/api/tag-groups/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/tag-groups/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1899,11 +1995,11 @@ def update_tag_group_with_http_info(id, tag_group_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api/templates_api.rb b/lib/klaviyo-api-sdk/api/templates_api.rb index fd1f2a2..bd95f07 100644 --- a/lib/klaviyo-api-sdk/api/templates_api.rb +++ b/lib/klaviyo-api-sdk/api/templates_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -19,31 +19,34 @@ class TemplatesApi def initialize(api_client = ApiClient.default) @api_client = api_client end - # Create Template - # Create a new custom HTML template. If there are 1,000 or more templates in an account, creation will fail as there is a limit of 1,000 templates that can be created via the API. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets).

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` - # @param template_create_query [TemplateCreateQuery] + # Clone Template + # Create a clone of a template with the given template ID. If there are 1,000 or more templates in an account, cloning will fail as there is a limit of 1,000 templates that can be created via the API.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` + # @param template_clone_query [TemplateCloneQuery] # @param [Hash] opts the optional parameters # @return [Hash] - def create_template(template_create_query, opts = {}) - data, _status_code, _headers = create_template_with_http_info(template_create_query, opts) + def clone_template(template_clone_query, opts = {}) + data, _status_code, _headers = clone_template_with_http_info(template_clone_query, opts) data end - # Create Template - # Create a new custom HTML template. If there are 1,000 or more templates in an account, creation will fail as there is a limit of 1,000 templates that can be created via the API. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` - # @param template_create_query [TemplateCreateQuery] + # alias of `clone_template` + alias create_template_clone clone_template + + # Clone Template + # Create a clone of a template with the given template ID. If there are 1,000 or more templates in an account, cloning will fail as there is a limit of 1,000 templates that can be created via the API.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` + # @param template_clone_query [TemplateCloneQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_template_with_http_info(template_create_query, opts = {}) + def clone_template_with_http_info(template_clone_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TemplatesApi.create_template ...' + @api_client.config.logger.debug 'Calling API: TemplatesApi.clone_template ...' end - # verify the required parameter 'template_create_query' is set - if @api_client.config.client_side_validation && template_create_query.nil? - fail ArgumentError, "Missing the required parameter 'template_create_query' when calling TemplatesApi.create_template" + # verify the required parameter 'template_clone_query' is set + if @api_client.config.client_side_validation && template_clone_query.nil? + fail ArgumentError, "Missing the required parameter 'template_clone_query' when calling TemplatesApi.clone_template" end # resource path - local_var_path = '/api/templates/' + local_var_path = '/api/template-clone' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +54,11 @@ def create_template_with_http_info(template_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -64,7 +67,7 @@ def create_template_with_http_info(template_create_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(template_create_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(template_clone_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -73,7 +76,7 @@ def create_template_with_http_info(template_create_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TemplatesApi.create_template", + :operation => :"TemplatesApi.clone_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -84,36 +87,39 @@ def create_template_with_http_info(template_create_query, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TemplatesApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TemplatesApi#clone_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Template Clone - # Create a clone of a template with the given template ID. If there are 1,000 or more templates in an account, cloning will fail as there is a limit of 1,000 templates that can be created via the API.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` - # @param template_clone_query [TemplateCloneQuery] + # alias of `clone_template_with_http_info` + alias create_template_clone_with_http_info clone_template_with_http_info + + # Create Template + # Create a new custom HTML template. If there are 1,000 or more templates in an account, creation will fail as there is a limit of 1,000 templates that can be created via the API. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets).

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` + # @param template_create_query [TemplateCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] - def create_template_clone(template_clone_query, opts = {}) - data, _status_code, _headers = create_template_clone_with_http_info(template_clone_query, opts) + def create_template(template_create_query, opts = {}) + data, _status_code, _headers = create_template_with_http_info(template_create_query, opts) data end - # Create Template Clone - # Create a clone of a template with the given template ID. If there are 1,000 or more templates in an account, cloning will fail as there is a limit of 1,000 templates that can be created via the API.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` - # @param template_clone_query [TemplateCloneQuery] + # Create Template + # Create a new custom HTML template. If there are 1,000 or more templates in an account, creation will fail as there is a limit of 1,000 templates that can be created via the API. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` + # @param template_create_query [TemplateCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_template_clone_with_http_info(template_clone_query, opts = {}) + def create_template_with_http_info(template_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TemplatesApi.create_template_clone ...' + @api_client.config.logger.debug 'Calling API: TemplatesApi.create_template ...' end - # verify the required parameter 'template_clone_query' is set - if @api_client.config.client_side_validation && template_clone_query.nil? - fail ArgumentError, "Missing the required parameter 'template_clone_query' when calling TemplatesApi.create_template_clone" + # verify the required parameter 'template_create_query' is set + if @api_client.config.client_side_validation && template_create_query.nil? + fail ArgumentError, "Missing the required parameter 'template_create_query' when calling TemplatesApi.create_template" end # resource path - local_var_path = '/api/template-clone/' + local_var_path = '/api/templates' # query parameters query_params = opts[:query_params] || {} @@ -121,11 +127,11 @@ def create_template_clone_with_http_info(template_clone_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -134,7 +140,7 @@ def create_template_clone_with_http_info(template_clone_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(template_clone_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(template_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -143,7 +149,7 @@ def create_template_clone_with_http_info(template_clone_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TemplatesApi.create_template_clone", + :operation => :"TemplatesApi.create_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -154,36 +160,39 @@ def create_template_clone_with_http_info(template_clone_query, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TemplatesApi#create_template_clone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TemplatesApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Template Render - # Render a template with the given template ID and context attribute. Returns the HTML and plain text versions of the email template. **Request body parameters** (nested under `attributes`): * `return_fields`: Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets). * `context`: This is the context your email template will be rendered with. You must pass in a `context` object as a JSON object. Email templates are rendered with contexts in a similar manner to Django templates. Nested template variables can be referenced via dot notation. Template variables without corresponding `context` values are treated as `FALSE` and output nothing. Ex. `{ \"name\" : \"George Washington\", \"state\" : \"VA\" }`

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `templates:read` - # @param template_render_query [TemplateRenderQuery] + # Create Universal Content + # Create universal content. Only text blocks, which can include text or HTML, are supported at this time.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` + # @param universal_content_create_query [UniversalContentCreateQuery] Create a template universal content # @param [Hash] opts the optional parameters # @return [Hash] - def create_template_render(template_render_query, opts = {}) - data, _status_code, _headers = create_template_render_with_http_info(template_render_query, opts) + def create_universal_content(universal_content_create_query, opts = {}) + data, _status_code, _headers = create_universal_content_with_http_info(universal_content_create_query, opts) data end - # Create Template Render - # Render a template with the given template ID and context attribute. Returns the HTML and plain text versions of the email template. **Request body parameters** (nested under `attributes`): * `return_fields`: Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets). * `context`: This is the context your email template will be rendered with. You must pass in a `context` object as a JSON object. Email templates are rendered with contexts in a similar manner to Django templates. Nested template variables can be referenced via dot notation. Template variables without corresponding `context` values are treated as `FALSE` and output nothing. Ex. `{ \"name\" : \"George Washington\", \"state\" : \"VA\" }`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `templates:read` - # @param template_render_query [TemplateRenderQuery] + # alias of `create_universal_content` + alias create_template_universal_content create_universal_content + + # Create Universal Content + # Create universal content. Only text blocks, which can include text or HTML, are supported at this time.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` + # @param universal_content_create_query [UniversalContentCreateQuery] Create a template universal content # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def create_template_render_with_http_info(template_render_query, opts = {}) + def create_universal_content_with_http_info(universal_content_create_query, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TemplatesApi.create_template_render ...' + @api_client.config.logger.debug 'Calling API: TemplatesApi.create_universal_content ...' end - # verify the required parameter 'template_render_query' is set - if @api_client.config.client_side_validation && template_render_query.nil? - fail ArgumentError, "Missing the required parameter 'template_render_query' when calling TemplatesApi.create_template_render" + # verify the required parameter 'universal_content_create_query' is set + if @api_client.config.client_side_validation && universal_content_create_query.nil? + fail ArgumentError, "Missing the required parameter 'universal_content_create_query' when calling TemplatesApi.create_universal_content" end # resource path - local_var_path = '/api/template-render/' + local_var_path = '/api/template-universal-content' # query parameters query_params = opts[:query_params] || {} @@ -191,11 +200,11 @@ def create_template_render_with_http_info(template_render_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -204,7 +213,7 @@ def create_template_render_with_http_info(template_render_query, opts = {}) form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(template_render_query) + post_body = opts[:debug_body] || @api_client.object_to_http_body(universal_content_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' @@ -213,7 +222,7 @@ def create_template_render_with_http_info(template_render_query, opts = {}) auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( - :operation => :"TemplatesApi.create_template_render", + :operation => :"TemplatesApi.create_universal_content", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -224,11 +233,14 @@ def create_template_render_with_http_info(template_render_query, opts = {}) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TemplatesApi#create_template_render\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TemplatesApi#create_universal_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # alias of `create_universal_content_with_http_info` + alias create_template_universal_content_with_http_info create_universal_content_with_http_info + # Delete Template # Delete a template with the given template ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` # @param id [String] The ID of template @@ -253,7 +265,7 @@ def delete_template_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling TemplatesApi.delete_template" end # resource path - local_var_path = '/api/templates/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/templates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -261,9 +273,9 @@ def delete_template_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -294,11 +306,178 @@ def delete_template_with_http_info(id, opts = {}) return data, status_code, headers end + # Delete Universal Content + # Delete the universal content with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` + # @param id [String] The ID of the template universal content + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_universal_content(id, opts = {}) + delete_universal_content_with_http_info(id, opts) + nil + end + + # alias of `delete_universal_content` + alias delete_template_universal_content delete_universal_content + + # Delete Universal Content + # Delete the universal content with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` + # @param id [String] The ID of the template universal content + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_universal_content_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplatesApi.delete_universal_content ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TemplatesApi.delete_universal_content" + end + # resource path + local_var_path = '/api/template-universal-content/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TemplatesApi.delete_universal_content", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplatesApi#delete_universal_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `delete_universal_content_with_http_info` + alias delete_template_universal_content_with_http_info delete_universal_content_with_http_info + + # Get All Universal Content + # Get all universal content in an account.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Hash] + def get_all_universal_content(opts = {}) + data, _status_code, _headers = get_all_universal_content_with_http_info(opts) + data + end + + # alias of `get_all_universal_content` + alias get_template_universal_content get_all_universal_content + + # Get All Universal Content + # Get all universal content in an account.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20) + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_all_universal_content_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplatesApi.get_all_universal_content ...' + end + allowable_values = ["name", "definition", "definition.content_type", "definition.type", "definition.data", "definition.data.content", "definition.data.display_options", "definition.data.display_options.show_on", "definition.data.display_options.visible_check", "definition.data.display_options.content_repeat", "definition.data.display_options.content_repeat.repeat_for", "definition.data.display_options.content_repeat.item_alias", "definition.data.styles", "definition.data.styles.block_background_color", "definition.data.styles.block_border_color", "definition.data.styles.block_border_style", "definition.data.styles.block_border_width", "definition.data.styles.block_padding_bottom", "definition.data.styles.block_padding_left", "definition.data.styles.block_padding_right", "definition.data.styles.block_padding_top", "definition.data.styles.color", "definition.data.styles.extra_css_class", "definition.data.styles.font_family", "definition.data.styles.font_size", "definition.data.styles.font_style", "definition.data.styles.font_weight", "definition.data.styles.inner_padding_bottom", "definition.data.styles.inner_padding_left", "definition.data.styles.inner_padding_right", "definition.data.styles.inner_padding_top", "definition.data.styles.mobile_stretch_content", "definition.data.styles.background_color", "definition.data.styles.letter_spacing", "definition.data.styles.line_height", "definition.data.styles.text_align", "definition.data.styles.text_decoration", "definition.data.styles.text_table_layout", "created", "updated", "screenshot_status", "screenshot_url"] + if @api_client.config.client_side_validation && opts[:'fields_template_universal_content'] && !opts[:'fields_template_universal_content'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_template_universal_content\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TemplatesApi.get_all_universal_content, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TemplatesApi.get_all_universal_content, must be greater than or equal to 1.' + end + + allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/template-universal-content' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[template-universal-content]'] = @api_client.build_collection_param(opts[:'fields_template_universal_content'], :csv) if !opts[:'fields_template_universal_content'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TemplatesApi.get_all_universal_content", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplatesApi#get_all_universal_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `get_all_universal_content_with_http_info` + alias get_template_universal_content_with_http_info get_all_universal_content_with_http_info + # Get Template # Get a template with the given template ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:read` # @param id [String] The ID of template # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Hash] def get_template(id, opts = {}) data, _status_code, _headers = get_template_with_http_info(id, opts) @@ -309,7 +488,7 @@ def get_template(id, opts = {}) # Get a template with the given template ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:read` # @param id [String] The ID of template # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_template_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -324,7 +503,7 @@ def get_template_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"fields_template\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/templates/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/templates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -333,9 +512,9 @@ def get_template_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -369,10 +548,10 @@ def get_template_with_http_info(id, opts = {}) # Get Templates # Get all templates in an account. Filter to request a subset of all templates. Templates can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Returns a maximum of 10 results per page.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Hash] def get_templates(opts = {}) data, _status_code, _headers = get_templates_with_http_info(opts) @@ -382,10 +561,10 @@ def get_templates(opts = {}) # Get Templates # Get all templates in an account. Filter to request a subset of all templates. Templates can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Returns a maximum of 10 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` - # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#pagination - # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sorting + # @option opts [Array] :fields_template For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_templates_with_http_info(opts = {}) if @api_client.config.debugging @@ -400,7 +579,7 @@ def get_templates_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/templates/' + local_var_path = '/api/templates' # query parameters query_params = opts[:query_params] || {} @@ -412,9 +591,9 @@ def get_templates_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -445,6 +624,154 @@ def get_templates_with_http_info(opts = {}) return data, status_code, headers end + # Get Universal Content + # Get the universal content with the given ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:read` + # @param id [String] The ID of the universal content + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_universal_content(id, opts = {}) + data, _status_code, _headers = get_universal_content_with_http_info(id, opts) + data + end + + # Get Universal Content + # Get the universal content with the given ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:read` + # @param id [String] The ID of the universal content + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_template_universal_content For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_universal_content_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplatesApi.get_universal_content ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TemplatesApi.get_universal_content" + end + allowable_values = ["name", "definition", "definition.content_type", "definition.type", "definition.data", "definition.data.content", "definition.data.display_options", "definition.data.display_options.show_on", "definition.data.display_options.visible_check", "definition.data.display_options.content_repeat", "definition.data.display_options.content_repeat.repeat_for", "definition.data.display_options.content_repeat.item_alias", "definition.data.styles", "definition.data.styles.block_background_color", "definition.data.styles.block_border_color", "definition.data.styles.block_border_style", "definition.data.styles.block_border_width", "definition.data.styles.block_padding_bottom", "definition.data.styles.block_padding_left", "definition.data.styles.block_padding_right", "definition.data.styles.block_padding_top", "definition.data.styles.color", "definition.data.styles.extra_css_class", "definition.data.styles.font_family", "definition.data.styles.font_size", "definition.data.styles.font_style", "definition.data.styles.font_weight", "definition.data.styles.inner_padding_bottom", "definition.data.styles.inner_padding_left", "definition.data.styles.inner_padding_right", "definition.data.styles.inner_padding_top", "definition.data.styles.mobile_stretch_content", "definition.data.styles.background_color", "definition.data.styles.letter_spacing", "definition.data.styles.line_height", "definition.data.styles.text_align", "definition.data.styles.text_decoration", "definition.data.styles.text_table_layout", "created", "updated", "screenshot_status", "screenshot_url"] + if @api_client.config.client_side_validation && opts[:'fields_template_universal_content'] && !opts[:'fields_template_universal_content'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_template_universal_content\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/template-universal-content/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[template-universal-content]'] = @api_client.build_collection_param(opts[:'fields_template_universal_content'], :csv) if !opts[:'fields_template_universal_content'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TemplatesApi.get_universal_content", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplatesApi#get_universal_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Render Template + # Render a template with the given template ID and context attribute. Returns the HTML and plain text versions of the email template. **Request body parameters** (nested under `attributes`): * `return_fields`: Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets). * `context`: This is the context your email template will be rendered with. You must pass in a `context` object as a JSON object. Email templates are rendered with contexts in a similar manner to Django templates. Nested template variables can be referenced via dot notation. Template variables without corresponding `context` values are treated as `FALSE` and output nothing. Ex. `{ \"name\" : \"George Washington\", \"state\" : \"VA\" }`

*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `templates:read` + # @param template_render_query [TemplateRenderQuery] + # @param [Hash] opts the optional parameters + # @return [Hash] + def render_template(template_render_query, opts = {}) + data, _status_code, _headers = render_template_with_http_info(template_render_query, opts) + data + end + + # alias of `render_template` + alias create_template_render render_template + + # Render Template + # Render a template with the given template ID and context attribute. Returns the HTML and plain text versions of the email template. **Request body parameters** (nested under `attributes`): * `return_fields`: Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets). * `context`: This is the context your email template will be rendered with. You must pass in a `context` object as a JSON object. Email templates are rendered with contexts in a similar manner to Django templates. Nested template variables can be referenced via dot notation. Template variables without corresponding `context` values are treated as `FALSE` and output nothing. Ex. `{ \"name\" : \"George Washington\", \"state\" : \"VA\" }`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `templates:read` + # @param template_render_query [TemplateRenderQuery] + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def render_template_with_http_info(template_render_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplatesApi.render_template ...' + end + # verify the required parameter 'template_render_query' is set + if @api_client.config.client_side_validation && template_render_query.nil? + fail ArgumentError, "Missing the required parameter 'template_render_query' when calling TemplatesApi.render_template" + end + # resource path + local_var_path = '/api/template-render' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(template_render_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TemplatesApi.render_template", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplatesApi#render_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `render_template_with_http_info` + alias create_template_render_with_http_info render_template_with_http_info + # Update Template # Update a template with the given template ID. Does not currently update drag & drop templates.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` # @param id [String] The ID of template @@ -475,7 +802,7 @@ def update_template_with_http_info(id, template_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'template_update_query' when calling TemplatesApi.update_template" end # resource path - local_var_path = '/api/templates/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/templates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -483,11 +810,11 @@ def update_template_with_http_info(id, template_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -520,5 +847,87 @@ def update_template_with_http_info(id, template_update_query, opts = {}) end return data, status_code, headers end + + # Update Universal Content + # Update universal content. The `definition` field can only be updated for text blocks at this time.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `templates:write` + # @param id [String] The ID of the template universal content + # @param universal_content_partial_update_query [UniversalContentPartialUpdateQuery] Update a universal content by ID + # @param [Hash] opts the optional parameters + # @return [Hash] + def update_universal_content(id, universal_content_partial_update_query, opts = {}) + data, _status_code, _headers = update_universal_content_with_http_info(id, universal_content_partial_update_query, opts) + data + end + + # alias of `update_universal_content` + alias update_template_universal_content update_universal_content + + # Update Universal Content + # Update universal content. The `definition` field can only be updated for text blocks at this time.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `templates:write` + # @param id [String] The ID of the template universal content + # @param universal_content_partial_update_query [UniversalContentPartialUpdateQuery] Update a universal content by ID + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def update_universal_content_with_http_info(id, universal_content_partial_update_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplatesApi.update_universal_content ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TemplatesApi.update_universal_content" + end + # verify the required parameter 'universal_content_partial_update_query' is set + if @api_client.config.client_side_validation && universal_content_partial_update_query.nil? + fail ArgumentError, "Missing the required parameter 'universal_content_partial_update_query' when calling TemplatesApi.update_universal_content" + end + # resource path + local_var_path = '/api/template-universal-content/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(universal_content_partial_update_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TemplatesApi.update_universal_content", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplatesApi#update_universal_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # alias of `update_universal_content_with_http_info` + alias update_template_universal_content_with_http_info update_universal_content_with_http_info end end diff --git a/lib/klaviyo-api-sdk/api/tracking_settings_api.rb b/lib/klaviyo-api-sdk/api/tracking_settings_api.rb new file mode 100644 index 0000000..3c6eadd --- /dev/null +++ b/lib/klaviyo-api-sdk/api/tracking_settings_api.rb @@ -0,0 +1,250 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'cgi' + +module KlaviyoAPI + class TrackingSettingsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get Tracking Setting + # Get the tracking setting with the given account ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `tracking-settings:read` + # @param id [String] The id of the tracking setting (account ID). + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Hash] + def get_tracking_setting(id, opts = {}) + data, _status_code, _headers = get_tracking_setting_with_http_info(id, opts) + data + end + + # Get Tracking Setting + # Get the tracking setting with the given account ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `tracking-settings:read` + # @param id [String] The id of the tracking setting (account ID). + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tracking_setting_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TrackingSettingsApi.get_tracking_setting ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TrackingSettingsApi.get_tracking_setting" + end + allowable_values = ["auto_add_parameters", "utm_source", "utm_source.flow", "utm_source.flow.type", "utm_source.flow.value", "utm_source.campaign", "utm_source.campaign.type", "utm_source.campaign.value", "utm_medium", "utm_medium.flow", "utm_medium.flow.type", "utm_medium.flow.value", "utm_medium.campaign", "utm_medium.campaign.type", "utm_medium.campaign.value", "utm_campaign", "utm_campaign.flow", "utm_campaign.flow.type", "utm_campaign.flow.value", "utm_campaign.campaign", "utm_campaign.campaign.type", "utm_campaign.campaign.value", "utm_id", "utm_id.flow", "utm_id.flow.type", "utm_id.flow.value", "utm_id.campaign", "utm_id.campaign.type", "utm_id.campaign.value", "utm_term", "utm_term.flow", "utm_term.flow.type", "utm_term.flow.value", "utm_term.campaign", "utm_term.campaign.type", "utm_term.campaign.value", "custom_parameters"] + if @api_client.config.client_side_validation && opts[:'fields_tracking_setting'] && !opts[:'fields_tracking_setting'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tracking_setting\", must include one of #{allowable_values}" + end + # resource path + local_var_path = '/api/tracking-settings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[tracking-setting]'] = @api_client.build_collection_param(opts[:'fields_tracking_setting'], :csv) if !opts[:'fields_tracking_setting'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TrackingSettingsApi.get_tracking_setting", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TrackingSettingsApi#get_tracking_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Tracking Settings + # Get all tracking settings in an account. Returns an array with a single tracking setting.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `tracking-settings:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 1. Min: 1. Max: 1. (default to 1) + # @return [Hash] + def get_tracking_settings(opts = {}) + data, _status_code, _headers = get_tracking_settings_with_http_info(opts) + data + end + + # Get Tracking Settings + # Get all tracking settings in an account. Returns an array with a single tracking setting.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `tracking-settings:read` + # @param [Hash] opts the optional parameters + # @option opts [Array] :fields_tracking_setting For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination + # @option opts [Integer] :page_size Default: 1. Min: 1. Max: 1. (default to 1) + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_tracking_settings_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TrackingSettingsApi.get_tracking_settings ...' + end + allowable_values = ["auto_add_parameters", "utm_source", "utm_source.flow", "utm_source.flow.type", "utm_source.flow.value", "utm_source.campaign", "utm_source.campaign.type", "utm_source.campaign.value", "utm_medium", "utm_medium.flow", "utm_medium.flow.type", "utm_medium.flow.value", "utm_medium.campaign", "utm_medium.campaign.type", "utm_medium.campaign.value", "utm_campaign", "utm_campaign.flow", "utm_campaign.flow.type", "utm_campaign.flow.value", "utm_campaign.campaign", "utm_campaign.campaign.type", "utm_campaign.campaign.value", "utm_id", "utm_id.flow", "utm_id.flow.type", "utm_id.flow.value", "utm_id.campaign", "utm_id.campaign.type", "utm_id.campaign.value", "utm_term", "utm_term.flow", "utm_term.flow.type", "utm_term.flow.value", "utm_term.campaign", "utm_term.campaign.type", "utm_term.campaign.value", "custom_parameters"] + if @api_client.config.client_side_validation && opts[:'fields_tracking_setting'] && !opts[:'fields_tracking_setting'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"fields_tracking_setting\", must include one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TrackingSettingsApi.get_tracking_settings, must be smaller than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TrackingSettingsApi.get_tracking_settings, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/api/tracking-settings' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fields[tracking-setting]'] = @api_client.build_collection_param(opts[:'fields_tracking_setting'], :csv) if !opts[:'fields_tracking_setting'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TrackingSettingsApi.get_tracking_settings", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TrackingSettingsApi#get_tracking_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Tracking Setting + # Update the tracking setting with the given account ID.

*Rate limits*:
Burst: `10/s`
Steady: `150/m` **Scopes:** `tracking-settings:write` + # @param id [String] The id of the tracking setting (account ID). + # @param tracking_setting_partial_update_query [TrackingSettingPartialUpdateQuery] DTO for updating tracking settings + # @param [Hash] opts the optional parameters + # @return [Hash] + def update_tracking_setting(id, tracking_setting_partial_update_query, opts = {}) + data, _status_code, _headers = update_tracking_setting_with_http_info(id, tracking_setting_partial_update_query, opts) + data + end + + # Update Tracking Setting + # Update the tracking setting with the given account ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `tracking-settings:write` + # @param id [String] The id of the tracking setting (account ID). + # @param tracking_setting_partial_update_query [TrackingSettingPartialUpdateQuery] DTO for updating tracking settings + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def update_tracking_setting_with_http_info(id, tracking_setting_partial_update_query, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TrackingSettingsApi.update_tracking_setting ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TrackingSettingsApi.update_tracking_setting" + end + # verify the required parameter 'tracking_setting_partial_update_query' is set + if @api_client.config.client_side_validation && tracking_setting_partial_update_query.nil? + fail ArgumentError, "Missing the required parameter 'tracking_setting_partial_update_query' when calling TrackingSettingsApi.update_tracking_setting" + end + # resource path + local_var_path = '/api/tracking-settings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # klaviyo api revision + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(tracking_setting_partial_update_query) + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] + + new_options = opts.merge( + :operation => :"TrackingSettingsApi.update_tracking_setting", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TrackingSettingsApi#update_tracking_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/klaviyo-api-sdk/api/webhooks_api.rb b/lib/klaviyo-api-sdk/api/webhooks_api.rb index b5adb10..ea3cd2e 100644 --- a/lib/klaviyo-api-sdk/api/webhooks_api.rb +++ b/lib/klaviyo-api-sdk/api/webhooks_api.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -43,7 +43,7 @@ def create_webhook_with_http_info(webhook_create_query, opts = {}) fail ArgumentError, "Missing the required parameter 'webhook_create_query' when calling WebhooksApi.create_webhook" end # resource path - local_var_path = '/api/webhooks/' + local_var_path = '/api/webhooks' # query parameters query_params = opts[:query_params] || {} @@ -51,11 +51,11 @@ def create_webhook_with_http_info(webhook_create_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end @@ -113,7 +113,7 @@ def delete_webhook_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.delete_webhook" end # resource path - local_var_path = '/api/webhooks/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -121,9 +121,9 @@ def delete_webhook_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -158,8 +158,8 @@ def delete_webhook_with_http_info(id, opts = {}) # Get the webhook with the given ID.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `webhooks:read` # @param id [String] The ID of the webhook. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_webhook(id, opts = {}) data, _status_code, _headers = get_webhook_with_http_info(id, opts) @@ -170,8 +170,8 @@ def get_webhook(id, opts = {}) # Get the webhook with the given ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read` # @param id [String] The ID of the webhook. # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_webhook_with_http_info(id, opts = {}) if @api_client.config.debugging @@ -190,7 +190,7 @@ def get_webhook_with_http_info(id, opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/webhooks/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -200,9 +200,9 @@ def get_webhook_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -257,7 +257,7 @@ def get_webhook_topic_with_http_info(id, opts = {}) fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook_topic" end # resource path - local_var_path = '/api/webhook-topics/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/webhook-topics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -265,9 +265,9 @@ def get_webhook_topic_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -316,7 +316,7 @@ def get_webhook_topics_with_http_info(opts = {}) @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_topics ...' end # resource path - local_var_path = '/api/webhook-topics/' + local_var_path = '/api/webhook-topics' # query parameters query_params = opts[:query_params] || {} @@ -324,9 +324,9 @@ def get_webhook_topics_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -360,8 +360,8 @@ def get_webhook_topics_with_http_info(opts = {}) # Get Webhooks # Get all webhooks in an account.

*Rate limits*:
Burst: `1/s`
Steady: `15/m` **Scopes:** `webhooks:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Hash] def get_webhooks(opts = {}) data, _status_code, _headers = get_webhooks_with_http_info(opts) @@ -371,8 +371,8 @@ def get_webhooks(opts = {}) # Get Webhooks # Get all webhooks in an account.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `webhooks:read` # @param [Hash] opts the optional parameters - # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#sparse-fieldsets - # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-07-15/reference/api-overview#relationships + # @option opts [Array] :fields_webhook For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets + # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_webhooks_with_http_info(opts = {}) if @api_client.config.debugging @@ -387,7 +387,7 @@ def get_webhooks_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path - local_var_path = '/api/webhooks/' + local_var_path = '/api/webhooks' # query parameters query_params = opts[:query_params] || {} @@ -397,9 +397,9 @@ def get_webhooks_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # form parameters form_params = opts[:form_params] || {} @@ -460,7 +460,7 @@ def update_webhook_with_http_info(id, webhook_partial_update_query, opts = {}) fail ArgumentError, "Missing the required parameter 'webhook_partial_update_query' when calling WebhooksApi.update_webhook" end # resource path - local_var_path = '/api/webhooks/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + local_var_path = '/api/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -468,11 +468,11 @@ def update_webhook_with_http_info(id, webhook_partial_update_query, opts = {}) # header parameters header_params = opts[:header_params] || {} # klaviyo api revision - header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15" + header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15" # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/vnd.api+json']) if !content_type.nil? header_params['Content-Type'] = content_type end diff --git a/lib/klaviyo-api-sdk/api_client.rb b/lib/klaviyo-api-sdk/api_client.rb index e4476ca..6112085 100644 --- a/lib/klaviyo-api-sdk/api_client.rb +++ b/lib/klaviyo-api-sdk/api_client.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -32,7 +32,7 @@ class ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(config = Configuration.default) @config = config - @user_agent = "klaviyo-api-ruby/9.0.0" + @user_agent = "klaviyo-api-ruby/10.0.0" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent diff --git a/lib/klaviyo-api-sdk/api_error.rb b/lib/klaviyo-api-sdk/api_error.rb index 19e630b..62c2e92 100644 --- a/lib/klaviyo-api-sdk/api_error.rb +++ b/lib/klaviyo-api-sdk/api_error.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/configuration.rb b/lib/klaviyo-api-sdk/configuration.rb index 16f38b1..6dbb99b 100644 --- a/lib/klaviyo-api-sdk/configuration.rb +++ b/lib/klaviyo-api-sdk/configuration.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/alltime_date_filter.rb b/lib/klaviyo-api-sdk/models/alltime_date_filter.rb index 8c0b500..b7d53b2 100644 --- a/lib/klaviyo-api-sdk/models/alltime_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/alltime_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/anniversary_date_filter.rb b/lib/klaviyo-api-sdk/models/anniversary_date_filter.rb index 4f4e8d0..2d5a9b9 100644 --- a/lib/klaviyo-api-sdk/models/anniversary_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/anniversary_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/any_enum.rb b/lib/klaviyo-api-sdk/models/any_enum.rb index 9d0e628..d038356 100644 --- a/lib/klaviyo-api-sdk/models/any_enum.rb +++ b/lib/klaviyo-api-sdk/models/any_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/api_enum.rb b/lib/klaviyo-api-sdk/models/api_enum.rb index e795d93..026dd7f 100644 --- a/lib/klaviyo-api-sdk/models/api_enum.rb +++ b/lib/klaviyo-api-sdk/models/api_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/api_method_filter.rb b/lib/klaviyo-api-sdk/models/api_method_filter.rb index 98fed44..632435e 100644 --- a/lib/klaviyo-api-sdk/models/api_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/api_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/audiences_sub_object.rb b/lib/klaviyo-api-sdk/models/audiences_sub_object.rb index 6dd6601..5345a01 100644 --- a/lib/klaviyo-api-sdk/models/audiences_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/audiences_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/back_in_stock_enum.rb b/lib/klaviyo-api-sdk/models/back_in_stock_enum.rb index deb1186..536faac 100644 --- a/lib/klaviyo-api-sdk/models/back_in_stock_enum.rb +++ b/lib/klaviyo-api-sdk/models/back_in_stock_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/back_in_stock_method_filter.rb b/lib/klaviyo-api-sdk/models/back_in_stock_method_filter.rb index d6abf0a..a91fe8d 100644 --- a/lib/klaviyo-api-sdk/models/back_in_stock_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/back_in_stock_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/back_in_stock_subscription_enum.rb b/lib/klaviyo-api-sdk/models/back_in_stock_subscription_enum.rb index 65026e9..b6bc2da 100644 --- a/lib/klaviyo-api-sdk/models/back_in_stock_subscription_enum.rb +++ b/lib/klaviyo-api-sdk/models/back_in_stock_subscription_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object.rb index 1103556..1542672 100644 --- a/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object_attributes.rb index 3a0adc0..b178064 100644 --- a/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/base_event_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/block_display_options.rb b/lib/klaviyo-api-sdk/models/block_display_options.rb new file mode 100644 index 0000000..7c13f51 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/block_display_options.rb @@ -0,0 +1,274 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class BlockDisplayOptions + # Show on. + attr_accessor :show_on + + attr_accessor :visible_check + + attr_accessor :content_repeat + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'show_on' => :'show_on', + :'visible_check' => :'visible_check', + :'content_repeat' => :'content_repeat' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'show_on' => :'String', + :'visible_check' => :'String', + :'content_repeat' => :'ContentRepeat' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'show_on', + :'visible_check', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::BlockDisplayOptions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::BlockDisplayOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'show_on') + self.show_on = attributes[:'show_on'] + end + + if attributes.key?(:'visible_check') + self.visible_check = attributes[:'visible_check'] + end + + if attributes.key?(:'content_repeat') + self.content_repeat = attributes[:'content_repeat'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + show_on_validator = EnumAttributeValidator.new('String', ["all", "desktop", "mobile"]) + return false unless show_on_validator.valid?(@show_on) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] show_on Object to be assigned + def show_on=(show_on) + validator = EnumAttributeValidator.new('String', ["all", "desktop", "mobile"]) + unless validator.valid?(show_on) + fail ArgumentError, "invalid value for \"show_on\", must be one of #{validator.allowable_values}." + end + @show_on = show_on + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + show_on == o.show_on && + visible_check == o.visible_check && + content_repeat == o.content_repeat + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [show_on, visible_check, content_repeat].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/block_enum.rb b/lib/klaviyo-api-sdk/models/block_enum.rb new file mode 100644 index 0000000..b0c9041 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/block_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class BlockEnum + BLOCK = "block".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = BlockEnum.constants.select { |c| BlockEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #BlockEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/boolean_enum.rb b/lib/klaviyo-api-sdk/models/boolean_enum.rb index a944698..3c2034e 100644 --- a/lib/klaviyo-api-sdk/models/boolean_enum.rb +++ b/lib/klaviyo-api-sdk/models/boolean_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/boolean_filter.rb b/lib/klaviyo-api-sdk/models/boolean_filter.rb index 95edbc6..c4d590d 100644 --- a/lib/klaviyo-api-sdk/models/boolean_filter.rb +++ b/lib/klaviyo-api-sdk/models/boolean_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/bounce_date_enum.rb b/lib/klaviyo-api-sdk/models/bounce_date_enum.rb index 4ee212e..349820c 100644 --- a/lib/klaviyo-api-sdk/models/bounce_date_enum.rb +++ b/lib/klaviyo-api-sdk/models/bounce_date_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/bounce_date_filter.rb b/lib/klaviyo-api-sdk/models/bounce_date_filter.rb index 1ee628f..55cef4d 100644 --- a/lib/klaviyo-api-sdk/models/bounce_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/bounce_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/bounce_date_filter_filter.rb b/lib/klaviyo-api-sdk/models/bounce_date_filter_filter.rb index 6c832db..52749be 100644 --- a/lib/klaviyo-api-sdk/models/bounce_date_filter_filter.rb +++ b/lib/klaviyo-api-sdk/models/bounce_date_filter_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/bulk_remove_enum.rb b/lib/klaviyo-api-sdk/models/bulk_remove_enum.rb index 709a486..f537412 100644 --- a/lib/klaviyo-api-sdk/models/bulk_remove_enum.rb +++ b/lib/klaviyo-api-sdk/models/bulk_remove_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/bulk_remove_method_filter.rb b/lib/klaviyo-api-sdk/models/bulk_remove_method_filter.rb index dcfe4a7..da0850c 100644 --- a/lib/klaviyo-api-sdk/models/bulk_remove_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/bulk_remove_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/calendar_date_filter.rb b/lib/klaviyo-api-sdk/models/calendar_date_filter.rb index 788b981..b4c6816 100644 --- a/lib/klaviyo-api-sdk/models/calendar_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/calendar_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_clone_query.rb b/lib/klaviyo-api-sdk/models/campaign_clone_query.rb index 75dd4ef..91fdea8 100644 --- a/lib/klaviyo-api-sdk/models/campaign_clone_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_clone_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object.rb index 481e5fe..89861bf 100644 --- a/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object_attributes.rb index bf00dbe..87c1f98 100644 --- a/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_clone_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_create_query.rb b/lib/klaviyo-api-sdk/models/campaign_create_query.rb index cf0275a..d1f5385 100644 --- a/lib/klaviyo-api-sdk/models/campaign_create_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object.rb index e587db3..4654286 100644 --- a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes.rb index 1c24f88..e803ce2 100644 --- a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_campaign_messages.rb b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_campaign_messages.rb index e211b66..2f0a7f3 100644 --- a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_campaign_messages.rb +++ b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_campaign_messages.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_send_options.rb b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_send_options.rb index ddf9bb6..7a6baf9 100644 --- a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_send_options.rb +++ b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_send_options.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_tracking_options.rb b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_tracking_options.rb index e430e2b..d121d1d 100644 --- a/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_tracking_options.rb +++ b/lib/klaviyo-api-sdk/models/campaign_create_query_resource_object_attributes_tracking_options.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_enum.rb b/lib/klaviyo-api-sdk/models/campaign_enum.rb index 11e4c3c..e0de8ae 100644 --- a/lib/klaviyo-api-sdk/models/campaign_enum.rb +++ b/lib/klaviyo-api-sdk/models/campaign_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query.rb b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query.rb index 1841f1e..c77383b 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object.rb index 97a8e0b..def7714 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships.rb index e806255..145e22f 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template.rb b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template.rb index 32b5ea4..f95fcf5 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template_data.rb b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template_data.rb index 8d27ec8..22cec86 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template_data.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_resource_object_relationships_template_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object.rb index ca84404..2c1a2ef 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes.rb index d810b45..b9efec6 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes_content.rb b/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes_content.rb index 48e92ab..48c78a5 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes_content.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_create_query_resource_object_attributes_content.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_enum.rb b/lib/klaviyo-api-sdk/models/campaign_message_enum.rb index 6a9b08e..5e58f6f 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_enum.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query.rb b/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query.rb index f3a25a1..b13123e 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object.rb index 7d41cd4..95a8109 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object_attributes.rb index 7e1abe1..f3156ca 100644 --- a/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_partial_update_query.rb b/lib/klaviyo-api-sdk/models/campaign_partial_update_query.rb index 6707c72..1529598 100644 --- a/lib/klaviyo-api-sdk/models/campaign_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object.rb index 375626f..3f8d34a 100644 --- a/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object_attributes.rb index c3675c5..94358c8 100644 --- a/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query.rb b/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query.rb index b048450..5adec90 100644 --- a/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query_resource_object.rb index 5edff7c..6cad829 100644 --- a/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_enum.rb b/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_enum.rb index a3b535e..109ce45 100644 --- a/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_send_job_create_query.rb b/lib/klaviyo-api-sdk/models/campaign_send_job_create_query.rb index f3bd189..9136b2c 100644 --- a/lib/klaviyo-api-sdk/models/campaign_send_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_send_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_send_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_send_job_create_query_resource_object.rb index 50532ba..c8d6f59 100644 --- a/lib/klaviyo-api-sdk/models/campaign_send_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_send_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_send_job_enum.rb b/lib/klaviyo-api-sdk/models/campaign_send_job_enum.rb index 5039f74..50727c5 100644 --- a/lib/klaviyo-api-sdk/models/campaign_send_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/campaign_send_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query.rb b/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query.rb index f8172b3..bc8a925 100644 --- a/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object.rb index 355eb43..14046a4 100644 --- a/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb index 9d65925..ad92c86 100644 --- a/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_tracking_setting_dynamic_param.rb b/lib/klaviyo-api-sdk/models/campaign_tracking_setting_dynamic_param.rb new file mode 100644 index 0000000..3af0299 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/campaign_tracking_setting_dynamic_param.rb @@ -0,0 +1,273 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class CampaignTrackingSettingDynamicParam + attr_accessor :type + + # The value of the tracking parameter + attr_accessor :value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'DynamicEnum', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::CampaignTrackingSettingDynamicParam` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::CampaignTrackingSettingDynamicParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @value.nil? + value_validator = EnumAttributeValidator.new('String', ["campaign_id", "campaign_name", "campaign_name_id", "campaign_name_send_day", "email_subject", "group_id", "group_name", "group_name_id", "link_alt_text", "message_type", "profile_external_id", "profile_id"]) + return false unless value_validator.valid?(@value) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] value Object to be assigned + def value=(value) + validator = EnumAttributeValidator.new('String', ["campaign_id", "campaign_name", "campaign_name_id", "campaign_name_send_day", "email_subject", "group_id", "group_name", "group_name_id", "link_alt_text", "message_type", "profile_external_id", "profile_id"]) + unless validator.valid?(value) + fail ArgumentError, "invalid value for \"value\", must be one of #{validator.allowable_values}." + end + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/campaign_tracking_setting_static_param.rb b/lib/klaviyo-api-sdk/models/campaign_tracking_setting_static_param.rb new file mode 100644 index 0000000..e56da16 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/campaign_tracking_setting_static_param.rb @@ -0,0 +1,239 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class CampaignTrackingSettingStaticParam + attr_accessor :type + + # The value of the tracking parameter + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'StaticEnum', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::CampaignTrackingSettingStaticParam` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::CampaignTrackingSettingStaticParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @value.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/campaign_values_report_enum.rb b/lib/klaviyo-api-sdk/models/campaign_values_report_enum.rb index d463842..867be3e 100644 --- a/lib/klaviyo-api-sdk/models/campaign_values_report_enum.rb +++ b/lib/klaviyo-api-sdk/models/campaign_values_report_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_values_request_dto.rb b/lib/klaviyo-api-sdk/models/campaign_values_request_dto.rb index c0fe65b..e30939c 100644 --- a/lib/klaviyo-api-sdk/models/campaign_values_request_dto.rb +++ b/lib/klaviyo-api-sdk/models/campaign_values_request_dto.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object.rb index 6920bae..72cc632 100644 --- a/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes.rb index cc55740..4481469 100644 --- a/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes_timeframe.rb b/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes_timeframe.rb index ab13942..5550cef 100644 --- a/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes_timeframe.rb +++ b/lib/klaviyo-api-sdk/models/campaign_values_request_dto_resource_object_attributes_timeframe.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/carrier_deactivation_enum.rb b/lib/klaviyo-api-sdk/models/carrier_deactivation_enum.rb index d3ffca7..785fb53 100644 --- a/lib/klaviyo-api-sdk/models/carrier_deactivation_enum.rb +++ b/lib/klaviyo-api-sdk/models/carrier_deactivation_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/carrier_deactivation_method_filter.rb b/lib/klaviyo-api-sdk/models/carrier_deactivation_method_filter.rb index fc99c92..963f98e 100644 --- a/lib/klaviyo-api-sdk/models/carrier_deactivation_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/carrier_deactivation_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_category_bulk_create_job_enum.rb index 9122a69..5eb19f3 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_bulk_delete_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_category_bulk_delete_job_enum.rb index 048edc5..17c30bc 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_bulk_delete_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_bulk_delete_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_bulk_update_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_category_bulk_update_job_enum.rb index a1b6af5..133dd8b 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_bulk_update_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_bulk_update_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb index fe29ed1..08c2fd4 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object.rb index c8a158e..bad4122 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes.rb index 08321cf..0ae292e 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes_categories.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes_categories.rb index bf2d093..99c2650 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes_categories.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_resource_object_attributes_categories.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb index 925b94f..ba05d5a 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object.rb index 48365d5..ba9c9e2 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_attributes.rb index d637d5c..e5c9348 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships.rb index cfab803..54b2f23 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items.rb index d2dd931..8729428 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items_data_inner.rb b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items_data_inner.rb index 8df230c..57c9eb7 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_create_query_resource_object_relationships_items_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb index 02aa534..0ff0169 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object.rb index 513e797..92a5948 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes.rb index 39dacf9..811d517 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes_categories.rb b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes_categories.rb index bfc701d..ea188a1 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes_categories.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_resource_object_attributes_categories.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_delete_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_category_delete_query_resource_object.rb index 36e1f5c..c2bc671 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_delete_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_delete_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_enum.rb b/lib/klaviyo-api-sdk/models/catalog_category_enum.rb index b6c5bd6..39c8315 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb b/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb index bdb739c..73bca6b 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb index ce172d1..afb8a16 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object.rb index 203eedb..80e159a 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes.rb index ea58c2d..81d5513 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes_categories.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes_categories.rb index c4aefc5..2e8d39f 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes_categories.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_resource_object_attributes_categories.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb index f18dec3..1f82cc9 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object.rb index 7fbeddb..838d5bd 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object_attributes.rb index 0080741..fa80f5a 100644 --- a/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_category_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_item_bulk_create_job_enum.rb index b292e5b..fee835d 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_bulk_delete_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_item_bulk_delete_job_enum.rb index 4cef296..a34caac 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_bulk_delete_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_bulk_delete_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_bulk_update_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_item_bulk_update_job_enum.rb index 53e6357..a182361 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_bulk_update_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_bulk_update_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb b/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb index 1fad6c8..5d9c899 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb index 1e936fd..e784e8b 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object.rb index aa5bc00..79c4aba 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes.rb index fd53ab7..b2d019e 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes_items.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes_items.rb index 8187138..e1390c9 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes_items.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_resource_object_attributes_items.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb index 1b818fa..0d7e169 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object.rb index 7d0fad0..1569e04 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_attributes.rb index e29d6e5..a194d27 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships.rb index be77eb8..ba848e2 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories.rb index 83535d7..1e4339e 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories_data_inner.rb b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories_data_inner.rb index 7721832..b7a9790 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_create_query_resource_object_relationships_categories_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb index 4f7866d..6b61f50 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object.rb index 057c6fb..0a555b3 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes.rb index e73c897..bba51f6 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes_items.rb b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes_items.rb index b8a51f1..6f9ee12 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes_items.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_resource_object_attributes_items.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_delete_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_item_delete_query_resource_object.rb index 18fbaa1..bc133e9 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_delete_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_delete_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_enum.rb b/lib/klaviyo-api-sdk/models/catalog_item_enum.rb index 8251781..7f23924 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb index 11ea3ab..1fe22f4 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object.rb index 37268eb..0904467 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes.rb index 59ac764..982c12f 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes_items.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes_items.rb index 7ca6577..8b92eeb 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes_items.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_resource_object_attributes_items.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb index 725b2d9..32d417e 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object.rb index 390c5a0..29dde34 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object_attributes.rb index 2778aa6..182a87d 100644 --- a/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_item_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_variant_bulk_create_job_enum.rb index 588dc12..f70cf4f 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_bulk_delete_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_variant_bulk_delete_job_enum.rb index f600509..7fe028f 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_bulk_delete_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_bulk_delete_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_bulk_update_job_enum.rb b/lib/klaviyo-api-sdk/models/catalog_variant_bulk_update_job_enum.rb index 1e22d22..0b30e14 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_bulk_update_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_bulk_update_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb index 31be8ba..37ca894 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object.rb index 75bafa9..30cec55 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes.rb index 169630e..eee6390 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes_variants.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes_variants.rb index e31f6c5..89e4d7a 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes_variants.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_resource_object_attributes_variants.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb index b91d0dd..07aaa55 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object.rb index 07208c7..54ab40e 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_attributes.rb index d123fe8..afd8c6a 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships.rb index 26764ac..bdbdfae 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item.rb index ea1174e..eb1098a 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item_data.rb b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item_data.rb index 9e021ad..5c7ef01 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item_data.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_create_query_resource_object_relationships_item_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb index a439050..3dadd46 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object.rb index 886da06..f25ca6c 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes.rb index f43afe7..1691922 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes_variants.rb b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes_variants.rb index dd00374..2ef409c 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes_variants.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_resource_object_attributes_variants.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_resource_object.rb index fd5bec0..920f641 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_enum.rb b/lib/klaviyo-api-sdk/models/catalog_variant_enum.rb index 35a5dce..86e1901 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_enum.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb index ea799d4..443f52c 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object.rb index ab01eb0..3657d18 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes.rb index 9ca3032..034b459 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes_variants.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes_variants.rb index cbd0776..96f3072 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes_variants.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_resource_object_attributes_variants.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb index a91685f..fe3970d 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object.rb index f9376c1..ed1b2d1 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object_attributes.rb index 35f39e9..5342afd 100644 --- a/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/catalog_variant_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/checkout_enum.rb b/lib/klaviyo-api-sdk/models/checkout_enum.rb index 609548c..5fa0881 100644 --- a/lib/klaviyo-api-sdk/models/checkout_enum.rb +++ b/lib/klaviyo-api-sdk/models/checkout_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/checkout_method_filter.rb b/lib/klaviyo-api-sdk/models/checkout_method_filter.rb index 8e40b62..2c577b6 100644 --- a/lib/klaviyo-api-sdk/models/checkout_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/checkout_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/condition_group.rb b/lib/klaviyo-api-sdk/models/condition_group.rb index 2f17c0f..9e49754 100644 --- a/lib/klaviyo-api-sdk/models/condition_group.rb +++ b/lib/klaviyo-api-sdk/models/condition_group.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/condition_group_conditions_inner.rb b/lib/klaviyo-api-sdk/models/condition_group_conditions_inner.rb index b315804..b37e8f4 100644 --- a/lib/klaviyo-api-sdk/models/condition_group_conditions_inner.rb +++ b/lib/klaviyo-api-sdk/models/condition_group_conditions_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/constant_contact_enum.rb b/lib/klaviyo-api-sdk/models/constant_contact_enum.rb index 2a55cd8..3e8560f 100644 --- a/lib/klaviyo-api-sdk/models/constant_contact_enum.rb +++ b/lib/klaviyo-api-sdk/models/constant_contact_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/constant_contact_integration_filter.rb b/lib/klaviyo-api-sdk/models/constant_contact_integration_filter.rb index 9e31e7f..24b80e1 100644 --- a/lib/klaviyo-api-sdk/models/constant_contact_integration_filter.rb +++ b/lib/klaviyo-api-sdk/models/constant_contact_integration_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/constant_contact_integration_method_filter.rb b/lib/klaviyo-api-sdk/models/constant_contact_integration_method_filter.rb index 0095b79..7af7b39 100644 --- a/lib/klaviyo-api-sdk/models/constant_contact_integration_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/constant_contact_integration_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/content_repeat.rb b/lib/klaviyo-api-sdk/models/content_repeat.rb new file mode 100644 index 0000000..5c60934 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/content_repeat.rb @@ -0,0 +1,238 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class ContentRepeat + attr_accessor :repeat_for + + attr_accessor :item_alias + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repeat_for' => :'repeat_for', + :'item_alias' => :'item_alias' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'repeat_for' => :'String', + :'item_alias' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ContentRepeat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ContentRepeat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'repeat_for') + self.repeat_for = attributes[:'repeat_for'] + end + + if attributes.key?(:'item_alias') + self.item_alias = attributes[:'item_alias'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @repeat_for.nil? + invalid_properties.push('invalid value for "repeat_for", repeat_for cannot be nil.') + end + + if @item_alias.nil? + invalid_properties.push('invalid value for "item_alias", item_alias cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @repeat_for.nil? + return false if @item_alias.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repeat_for == o.repeat_for && + item_alias == o.item_alias + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [repeat_for, item_alias].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/coupon_code_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/coupon_code_bulk_create_job_enum.rb index 6a036ef..edee2ae 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query.rb index 7ceeda0..6d1b87a 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object.rb index bc37440..2785416 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes.rb index 5d5b101..276c3fd 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes_coupon_codes.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes_coupon_codes.rb index 266064f..f2a0ee4 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes_coupon_codes.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_job_create_query_resource_object_attributes_coupon_codes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_query.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_query.rb index 8217b49..8f59dd7 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_query.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object.rb index 5404f9a..7993ad4 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_attributes.rb index 4dc2459..1a0dd49 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships.rb index 7a2c4da..5f5203a 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon.rb index 26aaae6..f1b76b3 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon_data.rb b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon_data.rb index 4563416..fee24e9 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon_data.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_create_query_resource_object_relationships_coupon_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_enum.rb b/lib/klaviyo-api-sdk/models/coupon_code_enum.rb index dc66b2e..6f3e864 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_enum.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_update_query.rb b/lib/klaviyo-api-sdk/models/coupon_code_update_query.rb index 8461dfd..bf887a5 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_update_query.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object.rb index 15c2816..3ab8e14 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object_attributes.rb index 7c2baee..7029ef1 100644 --- a/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/coupon_code_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_create_query.rb b/lib/klaviyo-api-sdk/models/coupon_create_query.rb index 57552e7..4a48278 100644 --- a/lib/klaviyo-api-sdk/models/coupon_create_query.rb +++ b/lib/klaviyo-api-sdk/models/coupon_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object.rb index 63bd4c1..c5671c9 100644 --- a/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object_attributes.rb index 62c4870..f760d3e 100644 --- a/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/coupon_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_enum.rb b/lib/klaviyo-api-sdk/models/coupon_enum.rb index 5ed344d..da35d7a 100644 --- a/lib/klaviyo-api-sdk/models/coupon_enum.rb +++ b/lib/klaviyo-api-sdk/models/coupon_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_update_query.rb b/lib/klaviyo-api-sdk/models/coupon_update_query.rb index dcbbac9..0ae0a0e 100644 --- a/lib/klaviyo-api-sdk/models/coupon_update_query.rb +++ b/lib/klaviyo-api-sdk/models/coupon_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object.rb index c48e070..762240a 100644 --- a/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object_attributes.rb index 446a6e7..6fd5a65 100644 --- a/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/coupon_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/custom_source_enum.rb b/lib/klaviyo-api-sdk/models/custom_source_enum.rb index e090c4b..cd50f74 100644 --- a/lib/klaviyo-api-sdk/models/custom_source_enum.rb +++ b/lib/klaviyo-api-sdk/models/custom_source_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/custom_source_filter.rb b/lib/klaviyo-api-sdk/models/custom_source_filter.rb index 85ac714..86d871a 100644 --- a/lib/klaviyo-api-sdk/models/custom_source_filter.rb +++ b/lib/klaviyo-api-sdk/models/custom_source_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/custom_timeframe.rb b/lib/klaviyo-api-sdk/models/custom_timeframe.rb index cd728af..a310069 100644 --- a/lib/klaviyo-api-sdk/models/custom_timeframe.rb +++ b/lib/klaviyo-api-sdk/models/custom_timeframe.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/custom_tracking_param_dto.rb b/lib/klaviyo-api-sdk/models/custom_tracking_param_dto.rb new file mode 100644 index 0000000..a54dc99 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/custom_tracking_param_dto.rb @@ -0,0 +1,245 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class CustomTrackingParamDTO + attr_accessor :flow + + attr_accessor :campaign + + # The name of the custom tracking parameter + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'flow' => :'flow', + :'campaign' => :'campaign', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'flow' => :'TrackingParamDTOFlow', + :'campaign' => :'TrackingParamDTOCampaign', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'flow', + :'campaign', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::CustomTrackingParamDTO` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::CustomTrackingParamDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'flow') + self.flow = attributes[:'flow'] + end + + if attributes.key?(:'campaign') + self.campaign = attributes[:'campaign'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + flow == o.flow && + campaign == o.campaign && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [flow, campaign, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query.rb b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query.rb index 3b3a6a1..50f2152 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object.rb b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object.rb index 65d29eb..8b15dac 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes.rb index 1319535..d2222f6 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes_profile.rb b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes_profile.rb index e9685e5..efc86c2 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes_profile.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_resource_object_attributes_profile.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/data_privacy_deletion_job_enum.rb b/lib/klaviyo-api-sdk/models/data_privacy_deletion_job_enum.rb index d774765..e059d29 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_deletion_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_deletion_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object.rb b/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object.rb index 0d3e375..6e5ad7c 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object_attributes.rb index 6121962..6aa9997 100644 --- a/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/data_privacy_profile_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/date_enum.rb b/lib/klaviyo-api-sdk/models/date_enum.rb index 33c5d7d..452c926 100644 --- a/lib/klaviyo-api-sdk/models/date_enum.rb +++ b/lib/klaviyo-api-sdk/models/date_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/device_metadata.rb b/lib/klaviyo-api-sdk/models/device_metadata.rb index cf60c50..24b6dbb 100644 --- a/lib/klaviyo-api-sdk/models/device_metadata.rb +++ b/lib/klaviyo-api-sdk/models/device_metadata.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -206,7 +206,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - klaviyo_sdk_validator = EnumAttributeValidator.new('String', ["android", "swift"]) + klaviyo_sdk_validator = EnumAttributeValidator.new('String', ["android", "react_native", "swift"]) return false unless klaviyo_sdk_validator.valid?(@klaviyo_sdk) os_name_validator = EnumAttributeValidator.new('String', ["android", "ios", "ipados", "macos", "tvos"]) return false unless os_name_validator.valid?(@os_name) @@ -218,7 +218,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] klaviyo_sdk Object to be assigned def klaviyo_sdk=(klaviyo_sdk) - validator = EnumAttributeValidator.new('String', ["android", "swift"]) + validator = EnumAttributeValidator.new('String', ["android", "react_native", "swift"]) unless validator.valid?(klaviyo_sdk) fail ArgumentError, "invalid value for \"klaviyo_sdk\", must be one of #{validator.allowable_values}." end diff --git a/lib/klaviyo-api-sdk/models/double_optin_filter.rb b/lib/klaviyo-api-sdk/models/double_optin_filter.rb index 653772b..71d78fa 100644 --- a/lib/klaviyo-api-sdk/models/double_optin_filter.rb +++ b/lib/klaviyo-api-sdk/models/double_optin_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/dynamic_enum.rb b/lib/klaviyo-api-sdk/models/dynamic_enum.rb new file mode 100644 index 0000000..b9e5fbf --- /dev/null +++ b/lib/klaviyo-api-sdk/models/dynamic_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class DynamicEnum + DYNAMIC = "dynamic".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = DynamicEnum.constants.select { |c| DynamicEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #DynamicEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/dynamic_tracking_param.rb b/lib/klaviyo-api-sdk/models/dynamic_tracking_param.rb new file mode 100644 index 0000000..ff226b8 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/dynamic_tracking_param.rb @@ -0,0 +1,288 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class DynamicTrackingParam + attr_accessor :type + + # The value of the tracking parameter + attr_accessor :value + + # Name of the tracking param + attr_accessor :name + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'DynamicEnum', + :'value' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::DynamicTrackingParam` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::DynamicTrackingParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @value.nil? + value_validator = EnumAttributeValidator.new('String', ["campaign_id", "campaign_name", "campaign_name_id", "campaign_name_send_day", "email_subject", "group_id", "group_name", "group_name_id", "link_alt_text", "message_type", "profile_external_id", "profile_id"]) + return false unless value_validator.valid?(@value) + return false if @name.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] value Object to be assigned + def value=(value) + validator = EnumAttributeValidator.new('String', ["campaign_id", "campaign_name", "campaign_name_id", "campaign_name_send_day", "email_subject", "group_id", "group_name", "group_name_id", "link_alt_text", "message_type", "profile_external_id", "profile_id"]) + unless validator.valid?(value) + fail ArgumentError, "invalid value for \"value\", must be one of #{validator.allowable_values}." + end + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/email_content_sub_object.rb b/lib/klaviyo-api-sdk/models/email_content_sub_object.rb index 31a07a0..80d4819 100644 --- a/lib/klaviyo-api-sdk/models/email_content_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/email_content_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/email_enum.rb b/lib/klaviyo-api-sdk/models/email_enum.rb index 2d20fe3..184ed20 100644 --- a/lib/klaviyo-api-sdk/models/email_enum.rb +++ b/lib/klaviyo-api-sdk/models/email_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/email_send_options_sub_object.rb b/lib/klaviyo-api-sdk/models/email_send_options_sub_object.rb index e540b3f..77ee992 100644 --- a/lib/klaviyo-api-sdk/models/email_send_options_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/email_send_options_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb b/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb index 060c56b..694b5c5 100644 --- a/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb +++ b/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -32,7 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'marketing' => :'MarketingSubscriptionParameters' + :'marketing' => :'SubscriptionParameters' } end diff --git a/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object.rb b/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object.rb index 6426fcb..d08517c 100644 --- a/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -15,11 +15,11 @@ module KlaviyoAPI class EmailTrackingOptionsSubObject - # Whether the campaign needs UTM parameters. If set to False, UTM params will not be used. - attr_accessor :is_add_utm + # Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used. + attr_accessor :add_tracking_params - # A list of UTM parameters. If an empty list is given and is_add_utm is True, uses company defaults. - attr_accessor :utm_params + # A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults. + attr_accessor :custom_tracking_params # Whether the campaign is tracking click events. If not specified, uses company defaults. attr_accessor :is_tracking_clicks @@ -30,8 +30,8 @@ class EmailTrackingOptionsSubObject # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'is_add_utm' => :'is_add_utm', - :'utm_params' => :'utm_params', + :'add_tracking_params' => :'add_tracking_params', + :'custom_tracking_params' => :'custom_tracking_params', :'is_tracking_clicks' => :'is_tracking_clicks', :'is_tracking_opens' => :'is_tracking_opens' } @@ -45,8 +45,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'is_add_utm' => :'Boolean', - :'utm_params' => :'Array', + :'add_tracking_params' => :'Boolean', + :'custom_tracking_params' => :'Array', :'is_tracking_clicks' => :'Boolean', :'is_tracking_opens' => :'Boolean' } @@ -55,8 +55,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'is_add_utm', - :'utm_params', + :'add_tracking_params', + :'custom_tracking_params', :'is_tracking_clicks', :'is_tracking_opens' ]) @@ -77,13 +77,13 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'is_add_utm') - self.is_add_utm = attributes[:'is_add_utm'] + if attributes.key?(:'add_tracking_params') + self.add_tracking_params = attributes[:'add_tracking_params'] end - if attributes.key?(:'utm_params') - if (value = attributes[:'utm_params']).is_a?(Array) - self.utm_params = value + if attributes.key?(:'custom_tracking_params') + if (value = attributes[:'custom_tracking_params']).is_a?(Array) + self.custom_tracking_params = value end end @@ -114,8 +114,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - is_add_utm == o.is_add_utm && - utm_params == o.utm_params && + add_tracking_params == o.add_tracking_params && + custom_tracking_params == o.custom_tracking_params && is_tracking_clicks == o.is_tracking_clicks && is_tracking_opens == o.is_tracking_opens end @@ -129,7 +129,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [is_add_utm, utm_params, is_tracking_clicks, is_tracking_opens].hash + [add_tracking_params, custom_tracking_params, is_tracking_clicks, is_tracking_opens].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object_custom_tracking_params_inner.rb b/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object_custom_tracking_params_inner.rb new file mode 100644 index 0000000..6634028 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/email_tracking_options_sub_object_custom_tracking_params_inner.rb @@ -0,0 +1,105 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + module EmailTrackingOptionsSubObjectCustomTrackingParamsInner + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'DynamicTrackingParam', + :'StaticTrackingParam' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = KlaviyoAPI.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/klaviyo-api-sdk/models/equals_enum.rb b/lib/klaviyo-api-sdk/models/equals_enum.rb index fe0ba9a..2863331 100644 --- a/lib/klaviyo-api-sdk/models/equals_enum.rb +++ b/lib/klaviyo-api-sdk/models/equals_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/equals_string_filter.rb b/lib/klaviyo-api-sdk/models/equals_string_filter.rb index 85cfb1f..4705676 100644 --- a/lib/klaviyo-api-sdk/models/equals_string_filter.rb +++ b/lib/klaviyo-api-sdk/models/equals_string_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_bulk_create_enum.rb b/lib/klaviyo-api-sdk/models/event_bulk_create_enum.rb index eaf7f94..bf48e7f 100644 --- a/lib/klaviyo-api-sdk/models/event_bulk_create_enum.rb +++ b/lib/klaviyo-api-sdk/models/event_bulk_create_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/event_bulk_create_job_enum.rb index b0480f8..e7026ca 100644 --- a/lib/klaviyo-api-sdk/models/event_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/event_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_create_query_v2.rb b/lib/klaviyo-api-sdk/models/event_create_query_v2.rb index 8ea7605..f9c29e8 100644 --- a/lib/klaviyo-api-sdk/models/event_create_query_v2.rb +++ b/lib/klaviyo-api-sdk/models/event_create_query_v2.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object.rb b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object.rb index d809ec9..bd87949 100644 --- a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb index 90d0956..d928da7 100644 --- a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_metric.rb b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_metric.rb index 4e0e386..0328efd 100644 --- a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_metric.rb +++ b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_metric.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_profile.rb b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_profile.rb index bf53189..99a1c58 100644 --- a/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_profile.rb +++ b/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes_profile.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_enum.rb b/lib/klaviyo-api-sdk/models/event_enum.rb index 04b7a25..0ed98c2 100644 --- a/lib/klaviyo-api-sdk/models/event_enum.rb +++ b/lib/klaviyo-api-sdk/models/event_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object.rb index 0c21c13..9debc62 100644 --- a/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object_attributes.rb index d581a73..15fdf29 100644 --- a/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/event_profile_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -38,6 +38,9 @@ class EventProfileCreateQueryResourceObjectAttributes # Name of the company or organization within the company for whom the individual works attr_accessor :organization + # The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + attr_accessor :locale + # Individual's job title attr_accessor :title @@ -62,6 +65,7 @@ def self.attribute_map :'first_name' => :'first_name', :'last_name' => :'last_name', :'organization' => :'organization', + :'locale' => :'locale', :'title' => :'title', :'image' => :'image', :'location' => :'location', @@ -86,6 +90,7 @@ def self.openapi_types :'first_name' => :'String', :'last_name' => :'String', :'organization' => :'String', + :'locale' => :'String', :'title' => :'String', :'image' => :'String', :'location' => :'ProfileLocation', @@ -105,6 +110,7 @@ def self.openapi_nullable :'first_name', :'last_name', :'organization', + :'locale', :'title', :'image', :'properties', @@ -158,6 +164,10 @@ def initialize(attributes = {}) self.organization = attributes[:'organization'] end + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -205,6 +215,7 @@ def ==(o) first_name == o.first_name && last_name == o.last_name && organization == o.organization && + locale == o.locale && title == o.title && image == o.image && location == o.location && @@ -221,7 +232,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, title, image, location, properties, meta].hash + [email, phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, locale, title, image, location, properties, meta].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_job.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_job.rb index 78f3774..77b6013 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_job.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_job.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object.rb index 502c66d..7dbc292 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes.rb index 4982319..091911b 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes_events_bulk_create.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes_events_bulk_create.rb index adf57e5..9edc934 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes_events_bulk_create.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_job_resource_object_attributes_events_bulk_create.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object.rb index f91fa5d..bf6e395 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb index e288497..5411dd7 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_events.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_events.rb index 5fc38f7..5b15b23 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_events.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_events.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_profile.rb b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_profile.rb index a4c621a..593576c 100644 --- a/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_profile.rb +++ b/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes_profile.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/existence_enum.rb b/lib/klaviyo-api-sdk/models/existence_enum.rb index 3fac8bc..43b9ea3 100644 --- a/lib/klaviyo-api-sdk/models/existence_enum.rb +++ b/lib/klaviyo-api-sdk/models/existence_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/existence_operator_filter.rb b/lib/klaviyo-api-sdk/models/existence_operator_filter.rb index 7797029..8715598 100644 --- a/lib/klaviyo-api-sdk/models/existence_operator_filter.rb +++ b/lib/klaviyo-api-sdk/models/existence_operator_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/failed_age_gate_enum.rb b/lib/klaviyo-api-sdk/models/failed_age_gate_enum.rb index 945ca51..5707209 100644 --- a/lib/klaviyo-api-sdk/models/failed_age_gate_enum.rb +++ b/lib/klaviyo-api-sdk/models/failed_age_gate_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/failed_age_gate_method_filter.rb b/lib/klaviyo-api-sdk/models/failed_age_gate_method_filter.rb index f6be5b4..85f94e5 100644 --- a/lib/klaviyo-api-sdk/models/failed_age_gate_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/failed_age_gate_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_enum.rb b/lib/klaviyo-api-sdk/models/flow_enum.rb index c178917..79b4ac0 100644 --- a/lib/klaviyo-api-sdk/models/flow_enum.rb +++ b/lib/klaviyo-api-sdk/models/flow_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_series_report_enum.rb b/lib/klaviyo-api-sdk/models/flow_series_report_enum.rb index 69e79af..03c2f89 100644 --- a/lib/klaviyo-api-sdk/models/flow_series_report_enum.rb +++ b/lib/klaviyo-api-sdk/models/flow_series_report_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_series_request_dto.rb b/lib/klaviyo-api-sdk/models/flow_series_request_dto.rb index 054a39a..8be8130 100644 --- a/lib/klaviyo-api-sdk/models/flow_series_request_dto.rb +++ b/lib/klaviyo-api-sdk/models/flow_series_request_dto.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object.rb index 4989836..6078442 100644 --- a/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object_attributes.rb index 89d00e7..813952f 100644 --- a/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/flow_series_request_dto_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_tracking_setting_dynamic_param.rb b/lib/klaviyo-api-sdk/models/flow_tracking_setting_dynamic_param.rb new file mode 100644 index 0000000..ec846f3 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/flow_tracking_setting_dynamic_param.rb @@ -0,0 +1,273 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FlowTrackingSettingDynamicParam + attr_accessor :type + + # The value of the tracking parameter + attr_accessor :value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'DynamicEnum', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FlowTrackingSettingDynamicParam` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FlowTrackingSettingDynamicParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @value.nil? + value_validator = EnumAttributeValidator.new('String', ["email_subject", "flow_id", "flow_name", "link_alt_text", "message_name", "message_name_id", "message_type", "profile_external_id", "profile_id"]) + return false unless value_validator.valid?(@value) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] value Object to be assigned + def value=(value) + validator = EnumAttributeValidator.new('String', ["email_subject", "flow_id", "flow_name", "link_alt_text", "message_name", "message_name_id", "message_type", "profile_external_id", "profile_id"]) + unless validator.valid?(value) + fail ArgumentError, "invalid value for \"value\", must be one of #{validator.allowable_values}." + end + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/utm_params_sub_object.rb b/lib/klaviyo-api-sdk/models/flow_tracking_setting_static_param.rb similarity index 90% rename from lib/klaviyo-api-sdk/models/utm_params_sub_object.rb rename to lib/klaviyo-api-sdk/models/flow_tracking_setting_static_param.rb index bc35779..3f5662b 100644 --- a/lib/klaviyo-api-sdk/models/utm_params_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/flow_tracking_setting_static_param.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -14,17 +14,16 @@ require 'time' module KlaviyoAPI - class UTMParamsSubObject - # Name of the UTM param - attr_accessor :name + class FlowTrackingSettingStaticParam + attr_accessor :type - # Value of the UTM param. Can be templated data. + # The value of the tracking parameter attr_accessor :value # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'name' => :'name', + :'type' => :'type', :'value' => :'value' } end @@ -37,7 +36,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'name' => :'String', + :'type' => :'StaticEnum', :'value' => :'String' } end @@ -52,19 +51,19 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UTMParamsSubObject` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FlowTrackingSettingStaticParam` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UTMParamsSubObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FlowTrackingSettingStaticParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'name') - self.name = attributes[:'name'] + if attributes.key?(:'type') + self.type = attributes[:'type'] end if attributes.key?(:'value') @@ -76,8 +75,8 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') end if @value.nil? @@ -90,7 +89,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @name.nil? + return false if @type.nil? return false if @value.nil? true end @@ -100,7 +99,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name && + type == o.type && value == o.value end @@ -113,7 +112,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, value].hash + [type, value].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/flow_update_query.rb b/lib/klaviyo-api-sdk/models/flow_update_query.rb index 68e5699..91e4c2e 100644 --- a/lib/klaviyo-api-sdk/models/flow_update_query.rb +++ b/lib/klaviyo-api-sdk/models/flow_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/flow_update_query_resource_object.rb index 8031fef..d276e01 100644 --- a/lib/klaviyo-api-sdk/models/flow_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/flow_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/flow_update_query_resource_object_attributes.rb index 7d00f3d..5fadef7 100644 --- a/lib/klaviyo-api-sdk/models/flow_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/flow_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_values_report_enum.rb b/lib/klaviyo-api-sdk/models/flow_values_report_enum.rb index 9939e77..e9911b5 100644 --- a/lib/klaviyo-api-sdk/models/flow_values_report_enum.rb +++ b/lib/klaviyo-api-sdk/models/flow_values_report_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_values_request_dto.rb b/lib/klaviyo-api-sdk/models/flow_values_request_dto.rb index a51823c..f8953cc 100644 --- a/lib/klaviyo-api-sdk/models/flow_values_request_dto.rb +++ b/lib/klaviyo-api-sdk/models/flow_values_request_dto.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object.rb index 607f189..5e58eca 100644 --- a/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object_attributes.rb index 0d3320d..261a76f 100644 --- a/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/flow_values_request_dto_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/form_enum.rb b/lib/klaviyo-api-sdk/models/form_enum.rb index 62f9198..11fa935 100644 --- a/lib/klaviyo-api-sdk/models/form_enum.rb +++ b/lib/klaviyo-api-sdk/models/form_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/form_method_filter.rb b/lib/klaviyo-api-sdk/models/form_method_filter.rb index b1b04cf..abfb8f4 100644 --- a/lib/klaviyo-api-sdk/models/form_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/form_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/form_series_report_enum.rb b/lib/klaviyo-api-sdk/models/form_series_report_enum.rb new file mode 100644 index 0000000..5625d63 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_series_report_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormSeriesReportEnum + FORM_SERIES_REPORT = "form-series-report".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormSeriesReportEnum.constants.select { |c| FormSeriesReportEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormSeriesReportEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/form_series_request_dto.rb b/lib/klaviyo-api-sdk/models/form_series_request_dto.rb new file mode 100644 index 0000000..a6bc3a4 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_series_request_dto.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormSeriesRequestDTO + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'FormSeriesRequestDTOResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FormSeriesRequestDTO` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FormSeriesRequestDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/form_series_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/form_series_request_dto_resource_object.rb new file mode 100644 index 0000000..e9714e6 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_series_request_dto_resource_object.rb @@ -0,0 +1,238 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormSeriesRequestDTOResourceObject + attr_accessor :type + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'FormSeriesReportEnum', + :'attributes' => :'FormSeriesRequestDTOResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FormSeriesRequestDTOResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FormSeriesRequestDTOResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/form_series_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/form_series_request_dto_resource_object_attributes.rb new file mode 100644 index 0000000..217f49b --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_series_request_dto_resource_object_attributes.rb @@ -0,0 +1,314 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormSeriesRequestDTOResourceObjectAttributes + # List of statistics to query for. All rate statistics will be returned in fractional form [0.0, 1.0] + attr_accessor :statistics + + attr_accessor :timeframe + + # The interval used to aggregate data within the series request. If hourly is used, the timeframe cannot be longer than 7 days. If daily is used, the timeframe cannot be longer than 60 days. If monthly is used, the timeframe cannot be longer than 52 weeks. + attr_accessor :interval + + # List of attributes to group the data by. Allowed group-bys are form_id, form_version_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id + attr_accessor :group_by + + # API filter string used to filter the query. Allowed filters are form_id, form_version_id. Allowed operators are equals, any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. + attr_accessor :filter + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statistics' => :'statistics', + :'timeframe' => :'timeframe', + :'interval' => :'interval', + :'group_by' => :'group_by', + :'filter' => :'filter' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'statistics' => :'Array', + :'timeframe' => :'CampaignValuesRequestDTOResourceObjectAttributesTimeframe', + :'interval' => :'String', + :'group_by' => :'Array', + :'filter' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'group_by', + :'filter' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FormSeriesRequestDTOResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FormSeriesRequestDTOResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statistics') + if (value = attributes[:'statistics']).is_a?(Array) + self.statistics = value + end + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + if @timeframe.nil? + invalid_properties.push('invalid value for "timeframe", timeframe cannot be nil.') + end + + if @interval.nil? + invalid_properties.push('invalid value for "interval", interval cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @statistics.nil? + return false if @timeframe.nil? + return false if @interval.nil? + interval_validator = EnumAttributeValidator.new('String', ["daily", "hourly", "monthly", "weekly"]) + return false unless interval_validator.valid?(@interval) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] interval Object to be assigned + def interval=(interval) + validator = EnumAttributeValidator.new('String', ["daily", "hourly", "monthly", "weekly"]) + unless validator.valid?(interval) + fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}." + end + @interval = interval + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statistics == o.statistics && + timeframe == o.timeframe && + interval == o.interval && + group_by == o.group_by && + filter == o.filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statistics, timeframe, interval, group_by, filter].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/form_values_report_enum.rb b/lib/klaviyo-api-sdk/models/form_values_report_enum.rb new file mode 100644 index 0000000..2f16416 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_values_report_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormValuesReportEnum + FORM_VALUES_REPORT = "form-values-report".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormValuesReportEnum.constants.select { |c| FormValuesReportEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormValuesReportEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/form_values_request_dto.rb b/lib/klaviyo-api-sdk/models/form_values_request_dto.rb new file mode 100644 index 0000000..cc2a06a --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_values_request_dto.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormValuesRequestDTO + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'FormValuesRequestDTOResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FormValuesRequestDTO` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FormValuesRequestDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/form_values_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/form_values_request_dto_resource_object.rb new file mode 100644 index 0000000..dbe28cb --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_values_request_dto_resource_object.rb @@ -0,0 +1,238 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormValuesRequestDTOResourceObject + attr_accessor :type + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'FormValuesReportEnum', + :'attributes' => :'FormValuesRequestDTOResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FormValuesRequestDTOResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FormValuesRequestDTOResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/form_values_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/form_values_request_dto_resource_object_attributes.rb new file mode 100644 index 0000000..1d7de7f --- /dev/null +++ b/lib/klaviyo-api-sdk/models/form_values_request_dto_resource_object_attributes.rb @@ -0,0 +1,287 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class FormValuesRequestDTOResourceObjectAttributes + # List of statistics to query for. All rate statistics will be returned in fractional form [0.0, 1.0] + attr_accessor :statistics + + attr_accessor :timeframe + + # List of attributes to group the data by. Allowed group-bys are form_id, form_version_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id + attr_accessor :group_by + + # API filter string used to filter the query. Allowed filters are form_id, form_version_id. Allowed operators are equals, any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter. + attr_accessor :filter + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statistics' => :'statistics', + :'timeframe' => :'timeframe', + :'group_by' => :'group_by', + :'filter' => :'filter' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'statistics' => :'Array', + :'timeframe' => :'CampaignValuesRequestDTOResourceObjectAttributesTimeframe', + :'group_by' => :'Array', + :'filter' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'group_by', + :'filter' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::FormValuesRequestDTOResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::FormValuesRequestDTOResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statistics') + if (value = attributes[:'statistics']).is_a?(Array) + self.statistics = value + end + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + if @timeframe.nil? + invalid_properties.push('invalid value for "timeframe", timeframe cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @statistics.nil? + return false if @timeframe.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statistics == o.statistics && + timeframe == o.timeframe && + group_by == o.group_by && + filter == o.filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statistics, timeframe, group_by, filter].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/get_accounts4_xx_response.rb b/lib/klaviyo-api-sdk/models/get_accounts4_xx_response.rb index a36af34..c329ba7 100644 --- a/lib/klaviyo-api-sdk/models/get_accounts4_xx_response.rb +++ b/lib/klaviyo-api-sdk/models/get_accounts4_xx_response.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner.rb b/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner.rb index b9566ff..83b74ba 100644 --- a/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner.rb +++ b/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner_source.rb b/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner_source.rb index 709ec45..4258dd0 100644 --- a/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner_source.rb +++ b/lib/klaviyo-api-sdk/models/get_accounts4_xx_response_errors_inner_source.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/greater_than_enum.rb b/lib/klaviyo-api-sdk/models/greater_than_enum.rb index 0875a86..088ee88 100644 --- a/lib/klaviyo-api-sdk/models/greater_than_enum.rb +++ b/lib/klaviyo-api-sdk/models/greater_than_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_email_marketing.rb b/lib/klaviyo-api-sdk/models/has_email_marketing.rb index b0282f0..6fd07ab 100644 --- a/lib/klaviyo-api-sdk/models/has_email_marketing.rb +++ b/lib/klaviyo-api-sdk/models/has_email_marketing.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_email_marketing_consent.rb b/lib/klaviyo-api-sdk/models/has_email_marketing_consent.rb index c20ea15..3db6594 100644 --- a/lib/klaviyo-api-sdk/models/has_email_marketing_consent.rb +++ b/lib/klaviyo-api-sdk/models/has_email_marketing_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_email_marketing_consent_consent_status.rb b/lib/klaviyo-api-sdk/models/has_email_marketing_consent_consent_status.rb index 4b69042..a71d792 100644 --- a/lib/klaviyo-api-sdk/models/has_email_marketing_consent_consent_status.rb +++ b/lib/klaviyo-api-sdk/models/has_email_marketing_consent_consent_status.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_email_marketing_never_subscribed.rb b/lib/klaviyo-api-sdk/models/has_email_marketing_never_subscribed.rb index ddc8c70..885e6f3 100644 --- a/lib/klaviyo-api-sdk/models/has_email_marketing_never_subscribed.rb +++ b/lib/klaviyo-api-sdk/models/has_email_marketing_never_subscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed.rb b/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed.rb index 27abe46..979d385 100644 --- a/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed.rb +++ b/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed_filters_inner.rb b/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed_filters_inner.rb index bbdb84a..ff131a6 100644 --- a/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed_filters_inner.rb +++ b/lib/klaviyo-api-sdk/models/has_email_marketing_subscribed_filters_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_push_marketing.rb b/lib/klaviyo-api-sdk/models/has_push_marketing.rb index 025d453..8e1ef25 100644 --- a/lib/klaviyo-api-sdk/models/has_push_marketing.rb +++ b/lib/klaviyo-api-sdk/models/has_push_marketing.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_push_marketing_consent.rb b/lib/klaviyo-api-sdk/models/has_push_marketing_consent.rb index 38a2062..f14c46a 100644 --- a/lib/klaviyo-api-sdk/models/has_push_marketing_consent.rb +++ b/lib/klaviyo-api-sdk/models/has_push_marketing_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_sms_marketing_consent.rb b/lib/klaviyo-api-sdk/models/has_sms_marketing_consent.rb index e5ee6a3..db44d8b 100644 --- a/lib/klaviyo-api-sdk/models/has_sms_marketing_consent.rb +++ b/lib/klaviyo-api-sdk/models/has_sms_marketing_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed.rb b/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed.rb index eee1733..41eb558 100644 --- a/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed.rb +++ b/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed_filters_inner.rb b/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed_filters_inner.rb index 9b3adff..07ab34c 100644 --- a/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed_filters_inner.rb +++ b/lib/klaviyo-api-sdk/models/has_sms_marketing_subscribed_filters_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/html_block.rb b/lib/klaviyo-api-sdk/models/html_block.rb new file mode 100644 index 0000000..38e588b --- /dev/null +++ b/lib/klaviyo-api-sdk/models/html_block.rb @@ -0,0 +1,252 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class HTMLBlock + attr_accessor :content_type + + attr_accessor :type + + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'content_type' => :'content_type', + :'type' => :'type', + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'content_type' => :'BlockEnum', + :'type' => :'HtmlEnum', + :'data' => :'HTMLBlockData' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::HTMLBlock` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::HTMLBlock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @content_type.nil? + invalid_properties.push('invalid value for "content_type", content_type cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @content_type.nil? + return false if @type.nil? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content_type == o.content_type && + type == o.type && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [content_type, type, data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/html_block_data.rb b/lib/klaviyo-api-sdk/models/html_block_data.rb new file mode 100644 index 0000000..55e7f27 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/html_block_data.rb @@ -0,0 +1,248 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class HTMLBlockData + attr_accessor :content + + attr_accessor :display_options + + attr_accessor :styles + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'content' => :'content', + :'display_options' => :'display_options', + :'styles' => :'styles' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'content' => :'String', + :'display_options' => :'BlockDisplayOptions', + :'styles' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'styles' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::HTMLBlockData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::HTMLBlockData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'display_options') + self.display_options = attributes[:'display_options'] + end + + if attributes.key?(:'styles') + self.styles = attributes[:'styles'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @content.nil? + invalid_properties.push('invalid value for "content", content cannot be nil.') + end + + if @display_options.nil? + invalid_properties.push('invalid value for "display_options", display_options cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @content.nil? + return false if @display_options.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + display_options == o.display_options && + styles == o.styles + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [content, display_options, styles].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/html_enum.rb b/lib/klaviyo-api-sdk/models/html_enum.rb new file mode 100644 index 0000000..cb9881e --- /dev/null +++ b/lib/klaviyo-api-sdk/models/html_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class HtmlEnum + HTML = "html".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = HtmlEnum.constants.select { |c| HtmlEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #HtmlEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/image_create_query.rb b/lib/klaviyo-api-sdk/models/image_create_query.rb index 1d02ef2..04c304c 100644 --- a/lib/klaviyo-api-sdk/models/image_create_query.rb +++ b/lib/klaviyo-api-sdk/models/image_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/image_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/image_create_query_resource_object.rb index e8f366a..1003c91 100644 --- a/lib/klaviyo-api-sdk/models/image_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/image_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/image_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/image_create_query_resource_object_attributes.rb index b45b826..e46d8ba 100644 --- a/lib/klaviyo-api-sdk/models/image_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/image_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/image_enum.rb b/lib/klaviyo-api-sdk/models/image_enum.rb index ec3d988..f7dfc62 100644 --- a/lib/klaviyo-api-sdk/models/image_enum.rb +++ b/lib/klaviyo-api-sdk/models/image_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/image_partial_update_query.rb b/lib/klaviyo-api-sdk/models/image_partial_update_query.rb index 088fda0..944f02a 100644 --- a/lib/klaviyo-api-sdk/models/image_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/image_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object.rb index 864cc9a..6909916 100644 --- a/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object_attributes.rb index 92213d9..75c0f94 100644 --- a/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/image_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/in_enum.rb b/lib/klaviyo-api-sdk/models/in_enum.rb index 19ff832..1dbca3c 100644 --- a/lib/klaviyo-api-sdk/models/in_enum.rb +++ b/lib/klaviyo-api-sdk/models/in_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/in_string_array_filter.rb b/lib/klaviyo-api-sdk/models/in_string_array_filter.rb index 5f0592c..f496ce2 100644 --- a/lib/klaviyo-api-sdk/models/in_string_array_filter.rb +++ b/lib/klaviyo-api-sdk/models/in_string_array_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/inbound_message_enum.rb b/lib/klaviyo-api-sdk/models/inbound_message_enum.rb index 4154af1..a1f66b6 100644 --- a/lib/klaviyo-api-sdk/models/inbound_message_enum.rb +++ b/lib/klaviyo-api-sdk/models/inbound_message_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/inbound_message_method_filter.rb b/lib/klaviyo-api-sdk/models/inbound_message_method_filter.rb index 6f24227..d217333 100644 --- a/lib/klaviyo-api-sdk/models/inbound_message_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/inbound_message_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/integration_enum.rb b/lib/klaviyo-api-sdk/models/integration_enum.rb index 3492ee6..9635ec1 100644 --- a/lib/klaviyo-api-sdk/models/integration_enum.rb +++ b/lib/klaviyo-api-sdk/models/integration_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/invalid_email_date_enum.rb b/lib/klaviyo-api-sdk/models/invalid_email_date_enum.rb index 27e5a39..afde2f7 100644 --- a/lib/klaviyo-api-sdk/models/invalid_email_date_enum.rb +++ b/lib/klaviyo-api-sdk/models/invalid_email_date_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/invalid_email_date_filter.rb b/lib/klaviyo-api-sdk/models/invalid_email_date_filter.rb index 6b5b944..ffc0343 100644 --- a/lib/klaviyo-api-sdk/models/invalid_email_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/invalid_email_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/is_double_opt_in_enum.rb b/lib/klaviyo-api-sdk/models/is_double_opt_in_enum.rb index 938bfcb..1c6a59a 100644 --- a/lib/klaviyo-api-sdk/models/is_double_opt_in_enum.rb +++ b/lib/klaviyo-api-sdk/models/is_double_opt_in_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/is_set_enum.rb b/lib/klaviyo-api-sdk/models/is_set_enum.rb index e9a2a13..9fe75f4 100644 --- a/lib/klaviyo-api-sdk/models/is_set_enum.rb +++ b/lib/klaviyo-api-sdk/models/is_set_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/is_set_existence_filter.rb b/lib/klaviyo-api-sdk/models/is_set_existence_filter.rb index 38bb829..9ffabbf 100644 --- a/lib/klaviyo-api-sdk/models/is_set_existence_filter.rb +++ b/lib/klaviyo-api-sdk/models/is_set_existence_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/less_than_enum.rb b/lib/klaviyo-api-sdk/models/less_than_enum.rb index b050a6b..c6f72dd 100644 --- a/lib/klaviyo-api-sdk/models/less_than_enum.rb +++ b/lib/klaviyo-api-sdk/models/less_than_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_contains_operator_filter.rb b/lib/klaviyo-api-sdk/models/list_contains_operator_filter.rb index b6f502e..36d4519 100644 --- a/lib/klaviyo-api-sdk/models/list_contains_operator_filter.rb +++ b/lib/klaviyo-api-sdk/models/list_contains_operator_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_contains_operator_filter_value.rb b/lib/klaviyo-api-sdk/models/list_contains_operator_filter_value.rb index 041781f..393e10d 100644 --- a/lib/klaviyo-api-sdk/models/list_contains_operator_filter_value.rb +++ b/lib/klaviyo-api-sdk/models/list_contains_operator_filter_value.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_create_query.rb b/lib/klaviyo-api-sdk/models/list_create_query.rb index c988ac7..3343e29 100644 --- a/lib/klaviyo-api-sdk/models/list_create_query.rb +++ b/lib/klaviyo-api-sdk/models/list_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/list_create_query_resource_object.rb index 826a8c9..4aa2fd6 100644 --- a/lib/klaviyo-api-sdk/models/list_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/list_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/list_create_query_resource_object_attributes.rb index 0bdb6a7..5d6edaf 100644 --- a/lib/klaviyo-api-sdk/models/list_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/list_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_enum.rb b/lib/klaviyo-api-sdk/models/list_enum.rb index f1eda87..9acd9b2 100644 --- a/lib/klaviyo-api-sdk/models/list_enum.rb +++ b/lib/klaviyo-api-sdk/models/list_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_length_filter.rb b/lib/klaviyo-api-sdk/models/list_length_filter.rb index a56c28e..72caa2d 100644 --- a/lib/klaviyo-api-sdk/models/list_length_filter.rb +++ b/lib/klaviyo-api-sdk/models/list_length_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_members_add_query.rb b/lib/klaviyo-api-sdk/models/list_members_add_query.rb index b0fcb2d..544d2ca 100644 --- a/lib/klaviyo-api-sdk/models/list_members_add_query.rb +++ b/lib/klaviyo-api-sdk/models/list_members_add_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb b/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb index 8154971..0f5040c 100644 --- a/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_members_delete_query.rb b/lib/klaviyo-api-sdk/models/list_members_delete_query.rb index 8902f60..2948178 100644 --- a/lib/klaviyo-api-sdk/models/list_members_delete_query.rb +++ b/lib/klaviyo-api-sdk/models/list_members_delete_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_partial_update_query.rb b/lib/klaviyo-api-sdk/models/list_partial_update_query.rb index 84087c4..a868a8d 100644 --- a/lib/klaviyo-api-sdk/models/list_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/list_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/list_partial_update_query_resource_object.rb index 51de8a0..b712132 100644 --- a/lib/klaviyo-api-sdk/models/list_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/list_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/list_set_filter.rb b/lib/klaviyo-api-sdk/models/list_set_filter.rb index dded5ef..7d92e78 100644 --- a/lib/klaviyo-api-sdk/models/list_set_filter.rb +++ b/lib/klaviyo-api-sdk/models/list_set_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -127,7 +127,7 @@ def list_invalid_properties def valid? return false if @type.nil? return false if @operator.nil? - operator_validator = EnumAttributeValidator.new('String', ["contains-any"]) + operator_validator = EnumAttributeValidator.new('String', ["contains-all", "contains-any", "not-contains-all", "not-contains-any"]) return false unless operator_validator.valid?(@operator) return false if @value.nil? true @@ -136,7 +136,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] operator Object to be assigned def operator=(operator) - validator = EnumAttributeValidator.new('String', ["contains-any"]) + validator = EnumAttributeValidator.new('String', ["contains-all", "contains-any", "not-contains-all", "not-contains-any"]) unless validator.valid?(operator) fail ArgumentError, "invalid value for \"operator\", must be one of #{validator.allowable_values}." end diff --git a/lib/klaviyo-api-sdk/models/list_substring_filter.rb b/lib/klaviyo-api-sdk/models/list_substring_filter.rb new file mode 100644 index 0000000..aac2ae0 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/list_substring_filter.rb @@ -0,0 +1,283 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class ListSubstringFilter + attr_accessor :type + + # Operators for list substring filters. + attr_accessor :operator + + attr_accessor :value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'operator' => :'operator', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'ListEnum', + :'operator' => :'String', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::ListSubstringFilter` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::ListSubstringFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'operator') + self.operator = attributes[:'operator'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @operator.nil? + invalid_properties.push('invalid value for "operator", operator cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @operator.nil? + operator_validator = EnumAttributeValidator.new('String', ["contains-substring", "not-contains-substring"]) + return false unless operator_validator.valid?(@operator) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] operator Object to be assigned + def operator=(operator) + validator = EnumAttributeValidator.new('String', ["contains-substring", "not-contains-substring"]) + unless validator.valid?(operator) + fail ArgumentError, "invalid value for \"operator\", must be one of #{validator.allowable_values}." + end + @operator = operator + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + operator == o.operator && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, operator, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/mailbox_provider_enum.rb b/lib/klaviyo-api-sdk/models/mailbox_provider_enum.rb index 15c9656..c92b8f5 100644 --- a/lib/klaviyo-api-sdk/models/mailbox_provider_enum.rb +++ b/lib/klaviyo-api-sdk/models/mailbox_provider_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/mailbox_provider_method_filter.rb b/lib/klaviyo-api-sdk/models/mailbox_provider_method_filter.rb index 71931c4..906f791 100644 --- a/lib/klaviyo-api-sdk/models/mailbox_provider_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/mailbox_provider_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_add_enum.rb b/lib/klaviyo-api-sdk/models/manual_add_enum.rb index 834c066..32c367a 100644 --- a/lib/klaviyo-api-sdk/models/manual_add_enum.rb +++ b/lib/klaviyo-api-sdk/models/manual_add_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_add_method_filter.rb b/lib/klaviyo-api-sdk/models/manual_add_method_filter.rb index 0b676fb..0aedcad 100644 --- a/lib/klaviyo-api-sdk/models/manual_add_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/manual_add_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_import_enum.rb b/lib/klaviyo-api-sdk/models/manual_import_enum.rb index 631d977..32ab1f2 100644 --- a/lib/klaviyo-api-sdk/models/manual_import_enum.rb +++ b/lib/klaviyo-api-sdk/models/manual_import_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_import_method_filter.rb b/lib/klaviyo-api-sdk/models/manual_import_method_filter.rb index 6937941..669f547 100644 --- a/lib/klaviyo-api-sdk/models/manual_import_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/manual_import_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_remove_enum.rb b/lib/klaviyo-api-sdk/models/manual_remove_enum.rb index c5fe65b..58e546c 100644 --- a/lib/klaviyo-api-sdk/models/manual_remove_enum.rb +++ b/lib/klaviyo-api-sdk/models/manual_remove_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_remove_method_filter.rb b/lib/klaviyo-api-sdk/models/manual_remove_method_filter.rb index 90c0c42..ef2235f 100644 --- a/lib/klaviyo-api-sdk/models/manual_remove_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/manual_remove_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_suppression_date_enum.rb b/lib/klaviyo-api-sdk/models/manual_suppression_date_enum.rb index 17c8482..a6c3cdd 100644 --- a/lib/klaviyo-api-sdk/models/manual_suppression_date_enum.rb +++ b/lib/klaviyo-api-sdk/models/manual_suppression_date_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/manual_suppression_date_filter.rb b/lib/klaviyo-api-sdk/models/manual_suppression_date_filter.rb index 2d808fc..4549947 100644 --- a/lib/klaviyo-api-sdk/models/manual_suppression_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/manual_suppression_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/message_blocked_enum.rb b/lib/klaviyo-api-sdk/models/message_blocked_enum.rb index f8632cf..896b002 100644 --- a/lib/klaviyo-api-sdk/models/message_blocked_enum.rb +++ b/lib/klaviyo-api-sdk/models/message_blocked_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/message_blocked_method_filter.rb b/lib/klaviyo-api-sdk/models/message_blocked_method_filter.rb index 6784754..e477d28 100644 --- a/lib/klaviyo-api-sdk/models/message_blocked_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/message_blocked_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/method_enum.rb b/lib/klaviyo-api-sdk/models/method_enum.rb index 7c0b0ee..eacbeb7 100644 --- a/lib/klaviyo-api-sdk/models/method_enum.rb +++ b/lib/klaviyo-api-sdk/models/method_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_aggregate_enum.rb b/lib/klaviyo-api-sdk/models/metric_aggregate_enum.rb index f39ab2b..763d10d 100644 --- a/lib/klaviyo-api-sdk/models/metric_aggregate_enum.rb +++ b/lib/klaviyo-api-sdk/models/metric_aggregate_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb b/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb index 97ae6a5..4699e4f 100644 --- a/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb +++ b/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object.rb b/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object.rb index 7a3e2f6..fb58fda 100644 --- a/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb index b841a24..016eff2 100644 --- a/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/metric_create_query_resource_object.rb index 86f25ff..9d85f82 100644 --- a/lib/klaviyo-api-sdk/models/metric_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/metric_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/metric_create_query_resource_object_attributes.rb index bf92cce..f7094b1 100644 --- a/lib/klaviyo-api-sdk/models/metric_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/metric_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/metric_enum.rb b/lib/klaviyo-api-sdk/models/metric_enum.rb index c1ecc8b..8fa9195 100644 --- a/lib/klaviyo-api-sdk/models/metric_enum.rb +++ b/lib/klaviyo-api-sdk/models/metric_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/never_subscribed_enum.rb b/lib/klaviyo-api-sdk/models/never_subscribed_enum.rb index 293c076..f6304f2 100644 --- a/lib/klaviyo-api-sdk/models/never_subscribed_enum.rb +++ b/lib/klaviyo-api-sdk/models/never_subscribed_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing.rb b/lib/klaviyo-api-sdk/models/no_email_marketing.rb index ea73b12..4cc85a8 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_consent.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_consent.rb index 6916bc4..369b4f2 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_consent.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_consent_consent_status.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_consent_consent_status.rb index 1bb26d0..728136e 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_consent_consent_status.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_consent_consent_status.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_filters_inner.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_filters_inner.rb index d15ea4a..baa5818 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_filters_inner.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_filters_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_never_subscribed.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_never_subscribed.rb index 7f184d9..8e21245 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_never_subscribed.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_never_subscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_subscribed.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_subscribed.rb index 0875d95..701475f 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_subscribed.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_subscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed.rb index 8bd672e..64148e2 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters.rb index 7c8b9cb..657050a 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters_one_of_inner.rb b/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters_one_of_inner.rb index a8e872c..532fddc 100644 --- a/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters_one_of_inner.rb +++ b/lib/klaviyo-api-sdk/models/no_email_marketing_unsubscribed_filters_one_of_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_push_marketing.rb b/lib/klaviyo-api-sdk/models/no_push_marketing.rb index ba16c49..bd9b8b5 100644 --- a/lib/klaviyo-api-sdk/models/no_push_marketing.rb +++ b/lib/klaviyo-api-sdk/models/no_push_marketing.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_push_marketing_consent.rb b/lib/klaviyo-api-sdk/models/no_push_marketing_consent.rb index 3499d9e..32b4ee2 100644 --- a/lib/klaviyo-api-sdk/models/no_push_marketing_consent.rb +++ b/lib/klaviyo-api-sdk/models/no_push_marketing_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_sms_marketing.rb b/lib/klaviyo-api-sdk/models/no_sms_marketing.rb index d21446b..ab0c82c 100644 --- a/lib/klaviyo-api-sdk/models/no_sms_marketing.rb +++ b/lib/klaviyo-api-sdk/models/no_sms_marketing.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_sms_marketing_consent.rb b/lib/klaviyo-api-sdk/models/no_sms_marketing_consent.rb index 6ce9b19..7c3e433 100644 --- a/lib/klaviyo-api-sdk/models/no_sms_marketing_consent.rb +++ b/lib/klaviyo-api-sdk/models/no_sms_marketing_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_sms_marketing_consent_consent_status.rb b/lib/klaviyo-api-sdk/models/no_sms_marketing_consent_consent_status.rb index 78d3ab7..70f23de 100644 --- a/lib/klaviyo-api-sdk/models/no_sms_marketing_consent_consent_status.rb +++ b/lib/klaviyo-api-sdk/models/no_sms_marketing_consent_consent_status.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_sms_marketing_never_subscribed.rb b/lib/klaviyo-api-sdk/models/no_sms_marketing_never_subscribed.rb index 5cebc29..5e1f1bf 100644 --- a/lib/klaviyo-api-sdk/models/no_sms_marketing_never_subscribed.rb +++ b/lib/klaviyo-api-sdk/models/no_sms_marketing_never_subscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed.rb b/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed.rb index 897747d..8e491db 100644 --- a/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed.rb +++ b/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed_filters_inner.rb b/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed_filters_inner.rb index d42a353..f6a8c51 100644 --- a/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed_filters_inner.rb +++ b/lib/klaviyo-api-sdk/models/no_sms_marketing_unsubscribed_filters_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/not_equals_enum.rb b/lib/klaviyo-api-sdk/models/not_equals_enum.rb index 462c0da..44da884 100644 --- a/lib/klaviyo-api-sdk/models/not_equals_enum.rb +++ b/lib/klaviyo-api-sdk/models/not_equals_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/numeric_enum.rb b/lib/klaviyo-api-sdk/models/numeric_enum.rb index 1217995..ba27ea9 100644 --- a/lib/klaviyo-api-sdk/models/numeric_enum.rb +++ b/lib/klaviyo-api-sdk/models/numeric_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/numeric_operator_filter.rb b/lib/klaviyo-api-sdk/models/numeric_operator_filter.rb index f26b920..6328e56 100644 --- a/lib/klaviyo-api-sdk/models/numeric_operator_filter.rb +++ b/lib/klaviyo-api-sdk/models/numeric_operator_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/numeric_operator_filter_value.rb b/lib/klaviyo-api-sdk/models/numeric_operator_filter_value.rb index 2642d90..bc1e365 100644 --- a/lib/klaviyo-api-sdk/models/numeric_operator_filter_value.rb +++ b/lib/klaviyo-api-sdk/models/numeric_operator_filter_value.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object.rb index f2859b3..bc3c460 100644 --- a/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object_attributes.rb index 980ec25..a34a0a8 100644 --- a/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/onsite_profile_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -38,6 +38,9 @@ class OnsiteProfileCreateQueryResourceObjectAttributes # Name of the company or organization within the company for whom the individual works attr_accessor :organization + # The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + attr_accessor :locale + # Individual's job title attr_accessor :title @@ -60,6 +63,7 @@ def self.attribute_map :'first_name' => :'first_name', :'last_name' => :'last_name', :'organization' => :'organization', + :'locale' => :'locale', :'title' => :'title', :'image' => :'image', :'location' => :'location', @@ -83,6 +87,7 @@ def self.openapi_types :'first_name' => :'String', :'last_name' => :'String', :'organization' => :'String', + :'locale' => :'String', :'title' => :'String', :'image' => :'String', :'location' => :'ProfileLocation', @@ -101,6 +106,7 @@ def self.openapi_nullable :'first_name', :'last_name', :'organization', + :'locale', :'title', :'image', :'properties' @@ -154,6 +160,10 @@ def initialize(attributes = {}) self.organization = attributes[:'organization'] end + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -197,6 +207,7 @@ def ==(o) first_name == o.first_name && last_name == o.last_name && organization == o.organization && + locale == o.locale && title == o.title && image == o.image && location == o.location && @@ -212,7 +223,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, title, image, location, properties].hash + [email, phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, locale, title, image, location, properties].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb b/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb index e348cf4..4516883 100644 --- a/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +++ b/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/preference_page_enum.rb b/lib/klaviyo-api-sdk/models/preference_page_enum.rb index 6ef0710..9a47e7f 100644 --- a/lib/klaviyo-api-sdk/models/preference_page_enum.rb +++ b/lib/klaviyo-api-sdk/models/preference_page_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/preference_page_filter.rb b/lib/klaviyo-api-sdk/models/preference_page_filter.rb index c7b249b..78f5d5b 100644 --- a/lib/klaviyo-api-sdk/models/preference_page_filter.rb +++ b/lib/klaviyo-api-sdk/models/preference_page_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/preference_page_method_filter.rb b/lib/klaviyo-api-sdk/models/preference_page_method_filter.rb index b6360c3..1cab35c 100644 --- a/lib/klaviyo-api-sdk/models/preference_page_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/preference_page_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_bulk_import_job_enum.rb b/lib/klaviyo-api-sdk/models/profile_bulk_import_job_enum.rb index ff9f605..8df6f35 100644 --- a/lib/klaviyo-api-sdk/models/profile_bulk_import_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_bulk_import_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_create_query.rb b/lib/klaviyo-api-sdk/models/profile_create_query.rb index 278b252..8ba5ccb 100644 --- a/lib/klaviyo-api-sdk/models/profile_create_query.rb +++ b/lib/klaviyo-api-sdk/models/profile_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_create_query_resource_object.rb index 8d530b4..5a7b29e 100644 --- a/lib/klaviyo-api-sdk/models/profile_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_create_query_resource_object_attributes.rb index d631af3..a0bb5f3 100644 --- a/lib/klaviyo-api-sdk/models/profile_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -33,6 +33,9 @@ class ProfileCreateQueryResourceObjectAttributes # Name of the company or organization within the company for whom the individual works attr_accessor :organization + # The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + attr_accessor :locale + # Individual's job title attr_accessor :title @@ -53,6 +56,7 @@ def self.attribute_map :'first_name' => :'first_name', :'last_name' => :'last_name', :'organization' => :'organization', + :'locale' => :'locale', :'title' => :'title', :'image' => :'image', :'location' => :'location', @@ -74,6 +78,7 @@ def self.openapi_types :'first_name' => :'String', :'last_name' => :'String', :'organization' => :'String', + :'locale' => :'String', :'title' => :'String', :'image' => :'String', :'location' => :'ProfileLocation', @@ -90,6 +95,7 @@ def self.openapi_nullable :'first_name', :'last_name', :'organization', + :'locale', :'title', :'image', :'properties' @@ -135,6 +141,10 @@ def initialize(attributes = {}) self.organization = attributes[:'organization'] end + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -176,6 +186,7 @@ def ==(o) first_name == o.first_name && last_name == o.last_name && organization == o.organization && + locale == o.locale && title == o.title && image == o.image && location == o.location && @@ -191,7 +202,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, phone_number, external_id, first_name, last_name, organization, title, image, location, properties].hash + [email, phone_number, external_id, first_name, last_name, organization, locale, title, image, location, properties].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/profile_enum.rb b/lib/klaviyo-api-sdk/models/profile_enum.rb index fbef289..e381df0 100644 --- a/lib/klaviyo-api-sdk/models/profile_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_group_membership_enum.rb b/lib/klaviyo-api-sdk/models/profile_group_membership_enum.rb index cf3ad5d..62e5387 100644 --- a/lib/klaviyo-api-sdk/models/profile_group_membership_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_group_membership_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition.rb b/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition.rb index 2b0e5dc..1086ad9 100644 --- a/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition_timeframe_filter.rb b/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition_timeframe_filter.rb index 5193019..0ef16a3 100644 --- a/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition_timeframe_filter.rb +++ b/lib/klaviyo-api-sdk/models/profile_has_group_membership_condition_timeframe_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object.rb index 990ddc7..912e646 100644 --- a/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object_attributes.rb index 80d6331..fd0d098 100644 --- a/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_identifier_dto_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query.rb index 212542d..571d600 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object.rb index 1095342..63a3e79 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes.rb index f89a2c6..7481447 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes_profiles.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes_profiles.rb index 3ca2b47..701333d 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes_profiles.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_attributes_profiles.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships.rb index e7f450c..d987a52 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists.rb index 9bf7cba..2cf7704 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists_data_inner.rb b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists_data_inner.rb index 339f035..215118b 100644 --- a/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/profile_import_job_create_query_resource_object_relationships_lists_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_location.rb b/lib/klaviyo-api-sdk/models/profile_location.rb index 88f0130..40af25e 100644 --- a/lib/klaviyo-api-sdk/models/profile_location.rb +++ b/lib/klaviyo-api-sdk/models/profile_location.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_location_latitude.rb b/lib/klaviyo-api-sdk/models/profile_location_latitude.rb index 8de5380..0e496c5 100644 --- a/lib/klaviyo-api-sdk/models/profile_location_latitude.rb +++ b/lib/klaviyo-api-sdk/models/profile_location_latitude.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_location_longitude.rb b/lib/klaviyo-api-sdk/models/profile_location_longitude.rb index 0fe4ca4..d3f43f9 100644 --- a/lib/klaviyo-api-sdk/models/profile_location_longitude.rb +++ b/lib/klaviyo-api-sdk/models/profile_location_longitude.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition.rb b/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition.rb index 456d97e..e5a4f2b 100644 --- a/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition_consent.rb b/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition_consent.rb index c850cd8..aaae20d 100644 --- a/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition_consent.rb +++ b/lib/klaviyo-api-sdk/models/profile_marketing_consent_condition_consent.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_marketing_consent_enum.rb b/lib/klaviyo-api-sdk/models/profile_marketing_consent_enum.rb index e520e7b..2fdea91 100644 --- a/lib/klaviyo-api-sdk/models/profile_marketing_consent_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_marketing_consent_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_merge_enum.rb b/lib/klaviyo-api-sdk/models/profile_merge_enum.rb index 7a5e07b..b18f554 100644 --- a/lib/klaviyo-api-sdk/models/profile_merge_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_merge_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_merge_query.rb b/lib/klaviyo-api-sdk/models/profile_merge_query.rb index 7e6bf31..6653852 100644 --- a/lib/klaviyo-api-sdk/models/profile_merge_query.rb +++ b/lib/klaviyo-api-sdk/models/profile_merge_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object.rb index e6dfa45..34589f4 100644 --- a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships.rb index d9a44a9..499bba8 100644 --- a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles.rb b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles.rb index fc10774..075638c 100644 --- a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles.rb +++ b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles_data_inner.rb b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles_data_inner.rb index 07a30e6..4a5967f 100644 --- a/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/profile_merge_query_resource_object_relationships_profiles_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_meta.rb b/lib/klaviyo-api-sdk/models/profile_meta.rb index 7d6a121..d4e6e1f 100644 --- a/lib/klaviyo-api-sdk/models/profile_meta.rb +++ b/lib/klaviyo-api-sdk/models/profile_meta.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_meta_patch_properties.rb b/lib/klaviyo-api-sdk/models/profile_meta_patch_properties.rb index 1e36aba..1a9776c 100644 --- a/lib/klaviyo-api-sdk/models/profile_meta_patch_properties.rb +++ b/lib/klaviyo-api-sdk/models/profile_meta_patch_properties.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_meta_patch_properties_unset.rb b/lib/klaviyo-api-sdk/models/profile_meta_patch_properties_unset.rb index b79720d..417d43b 100644 --- a/lib/klaviyo-api-sdk/models/profile_meta_patch_properties_unset.rb +++ b/lib/klaviyo-api-sdk/models/profile_meta_patch_properties_unset.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_metric_condition.rb b/lib/klaviyo-api-sdk/models/profile_metric_condition.rb index ce0f533..39e62e6 100644 --- a/lib/klaviyo-api-sdk/models/profile_metric_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_metric_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_metric_condition_timeframe_filter.rb b/lib/klaviyo-api-sdk/models/profile_metric_condition_timeframe_filter.rb index 3f15490..8cbbf60 100644 --- a/lib/klaviyo-api-sdk/models/profile_metric_condition_timeframe_filter.rb +++ b/lib/klaviyo-api-sdk/models/profile_metric_condition_timeframe_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_metric_enum.rb b/lib/klaviyo-api-sdk/models/profile_metric_enum.rb index 51fc7bb..917e92a 100644 --- a/lib/klaviyo-api-sdk/models/profile_metric_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_metric_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_metric_property_filter.rb b/lib/klaviyo-api-sdk/models/profile_metric_property_filter.rb index a5d0574..de8961f 100644 --- a/lib/klaviyo-api-sdk/models/profile_metric_property_filter.rb +++ b/lib/klaviyo-api-sdk/models/profile_metric_property_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_metric_property_filter_filter.rb b/lib/klaviyo-api-sdk/models/profile_metric_property_filter_filter.rb index 09c3ea9..61a71d1 100644 --- a/lib/klaviyo-api-sdk/models/profile_metric_property_filter_filter.rb +++ b/lib/klaviyo-api-sdk/models/profile_metric_property_filter_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -19,8 +19,14 @@ class << self # List of class defined in oneOf (OpenAPI v3) def openapi_one_of [ - :'EqualsStringFilter', - :'ListSetFilter' + :'BooleanFilter', + :'ExistenceOperatorFilter', + :'ListLengthFilter', + :'ListSetFilter', + :'ListSubstringFilter', + :'NumericOperatorFilter', + :'StringArrayOperatorFilter', + :'StringOperatorFilter' ] end diff --git a/lib/klaviyo-api-sdk/models/profile_no_group_membership_condition.rb b/lib/klaviyo-api-sdk/models/profile_no_group_membership_condition.rb index 1360475..2a791a3 100644 --- a/lib/klaviyo-api-sdk/models/profile_no_group_membership_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_no_group_membership_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb b/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb index 4718cd3..3e9bf66 100644 --- a/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object.rb index f71ed69..285adf6 100644 --- a/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object_attributes.rb index 868b342..cd333ba 100644 --- a/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -35,6 +35,9 @@ class ProfilePartialUpdateQueryResourceObjectAttributes # Name of the company or organization within the company for whom the individual works attr_accessor :organization + # The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + attr_accessor :locale + # Individual's job title attr_accessor :title @@ -56,6 +59,7 @@ def self.attribute_map :'first_name' => :'first_name', :'last_name' => :'last_name', :'organization' => :'organization', + :'locale' => :'locale', :'title' => :'title', :'image' => :'image', :'location' => :'location', @@ -78,6 +82,7 @@ def self.openapi_types :'first_name' => :'String', :'last_name' => :'String', :'organization' => :'String', + :'locale' => :'String', :'title' => :'String', :'image' => :'String', :'location' => :'ProfileLocation', @@ -95,6 +100,7 @@ def self.openapi_nullable :'first_name', :'last_name', :'organization', + :'locale', :'title', :'image', :'properties' @@ -144,6 +150,10 @@ def initialize(attributes = {}) self.organization = attributes[:'organization'] end + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -186,6 +196,7 @@ def ==(o) first_name == o.first_name && last_name == o.last_name && organization == o.organization && + locale == o.locale && title == o.title && image == o.image && location == o.location && @@ -201,7 +212,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, phone_number, external_id, anonymous_id, first_name, last_name, organization, title, image, location, properties].hash + [email, phone_number, external_id, anonymous_id, first_name, last_name, organization, locale, title, image, location, properties].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/profile_postal_code_distance_condition.rb b/lib/klaviyo-api-sdk/models/profile_postal_code_distance_condition.rb index 6c98604..d87af9d 100644 --- a/lib/klaviyo-api-sdk/models/profile_postal_code_distance_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_postal_code_distance_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_postal_code_distance_enum.rb b/lib/klaviyo-api-sdk/models/profile_postal_code_distance_enum.rb index 56b1ec8..8495b05 100644 --- a/lib/klaviyo-api-sdk/models/profile_postal_code_distance_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_postal_code_distance_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_enum.rb b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_enum.rb index 6f4636d..6e4c980 100644 --- a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_numeric_condition.rb b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_numeric_condition.rb index ad32768..851f26c 100644 --- a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_numeric_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_numeric_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_condition.rb b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_condition.rb index 226a0a0..4b30ea5 100644 --- a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter.rb b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter.rb index 4e4ba35..24bc54d 100644 --- a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter.rb +++ b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter_operator.rb b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter_operator.rb index 097176d..14c6ef4 100644 --- a/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter_operator.rb +++ b/lib/klaviyo-api-sdk/models/profile_predictive_analytics_string_filter_operator.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_property_condition.rb b/lib/klaviyo-api-sdk/models/profile_property_condition.rb index 832c138..aeee135 100644 --- a/lib/klaviyo-api-sdk/models/profile_property_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_property_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_property_condition_filter.rb b/lib/klaviyo-api-sdk/models/profile_property_condition_filter.rb index 4082308..06ee795 100644 --- a/lib/klaviyo-api-sdk/models/profile_property_condition_filter.rb +++ b/lib/klaviyo-api-sdk/models/profile_property_condition_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_property_enum.rb b/lib/klaviyo-api-sdk/models/profile_property_enum.rb index cf10fbf..0fa96da 100644 --- a/lib/klaviyo-api-sdk/models/profile_property_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_property_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_region_condition.rb b/lib/klaviyo-api-sdk/models/profile_region_condition.rb index 2acc924..3c220ed 100644 --- a/lib/klaviyo-api-sdk/models/profile_region_condition.rb +++ b/lib/klaviyo-api-sdk/models/profile_region_condition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_region_enum.rb b/lib/klaviyo-api-sdk/models/profile_region_enum.rb index 5fadbc9..ed01c78 100644 --- a/lib/klaviyo-api-sdk/models/profile_region_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_region_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_subscription_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/profile_subscription_bulk_create_job_enum.rb index f319dc9..0a2f160 100644 --- a/lib/klaviyo-api-sdk/models/profile_subscription_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_subscription_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_subscription_bulk_delete_job_enum.rb b/lib/klaviyo-api-sdk/models/profile_subscription_bulk_delete_job_enum.rb index b71efa0..df57c11 100644 --- a/lib/klaviyo-api-sdk/models/profile_subscription_bulk_delete_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_subscription_bulk_delete_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object.rb index 7e497cb..9998d49 100644 --- a/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object_attributes.rb index ab01437..cedb882 100644 --- a/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_subscription_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object.rb index 8d1b92d..2342052 100644 --- a/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb index 1e9f1a7..b99591a 100644 --- a/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_suppression_bulk_create_job_enum.rb b/lib/klaviyo-api-sdk/models/profile_suppression_bulk_create_job_enum.rb index 067387e..681c863 100644 --- a/lib/klaviyo-api-sdk/models/profile_suppression_bulk_create_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_suppression_bulk_create_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_suppression_bulk_delete_job_enum.rb b/lib/klaviyo-api-sdk/models/profile_suppression_bulk_delete_job_enum.rb index 10969a2..eca265a 100644 --- a/lib/klaviyo-api-sdk/models/profile_suppression_bulk_delete_job_enum.rb +++ b/lib/klaviyo-api-sdk/models/profile_suppression_bulk_delete_job_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object.rb index c74974f..f9d712e 100644 --- a/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object_attributes.rb index a120458..5176506 100644 --- a/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_suppression_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object.rb index fca1a15..784f259 100644 --- a/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object_attributes.rb index cf03ad0..9d21a94 100644 --- a/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_suppression_delete_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_upsert_query.rb b/lib/klaviyo-api-sdk/models/profile_upsert_query.rb index d7b19e4..d95bb31 100644 --- a/lib/klaviyo-api-sdk/models/profile_upsert_query.rb +++ b/lib/klaviyo-api-sdk/models/profile_upsert_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object.rb b/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object.rb index 852e41e..8e1bb4b 100644 --- a/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object_attributes.rb index b9b6b6a..7828541 100644 --- a/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/profile_upsert_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -39,6 +39,9 @@ class ProfileUpsertQueryResourceObjectAttributes # Name of the company or organization within the company for whom the individual works attr_accessor :organization + # The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + attr_accessor :locale + # Individual's job title attr_accessor :title @@ -61,6 +64,7 @@ def self.attribute_map :'first_name' => :'first_name', :'last_name' => :'last_name', :'organization' => :'organization', + :'locale' => :'locale', :'title' => :'title', :'image' => :'image', :'location' => :'location', @@ -84,6 +88,7 @@ def self.openapi_types :'first_name' => :'String', :'last_name' => :'String', :'organization' => :'String', + :'locale' => :'String', :'title' => :'String', :'image' => :'String', :'location' => :'ProfileLocation', @@ -102,6 +107,7 @@ def self.openapi_nullable :'first_name', :'last_name', :'organization', + :'locale', :'title', :'image', :'properties' @@ -155,6 +161,10 @@ def initialize(attributes = {}) self.organization = attributes[:'organization'] end + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -198,6 +208,7 @@ def ==(o) first_name == o.first_name && last_name == o.last_name && organization == o.organization && + locale == o.locale && title == o.title && image == o.image && location == o.location && @@ -213,7 +224,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, title, image, location, properties].hash + [email, phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, locale, title, image, location, properties].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/provided_landline_enum.rb b/lib/klaviyo-api-sdk/models/provided_landline_enum.rb index 75a369a..61557e1 100644 --- a/lib/klaviyo-api-sdk/models/provided_landline_enum.rb +++ b/lib/klaviyo-api-sdk/models/provided_landline_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/provided_landline_method_filter.rb b/lib/klaviyo-api-sdk/models/provided_landline_method_filter.rb index 4e27a93..89deb7f 100644 --- a/lib/klaviyo-api-sdk/models/provided_landline_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/provided_landline_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/provided_no_age_enum.rb b/lib/klaviyo-api-sdk/models/provided_no_age_enum.rb index fb1c730..33db6c4 100644 --- a/lib/klaviyo-api-sdk/models/provided_no_age_enum.rb +++ b/lib/klaviyo-api-sdk/models/provided_no_age_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/provided_no_age_method_filter.rb b/lib/klaviyo-api-sdk/models/provided_no_age_method_filter.rb index aedde1b..9689c08 100644 --- a/lib/klaviyo-api-sdk/models/provided_no_age_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/provided_no_age_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_enum.rb b/lib/klaviyo-api-sdk/models/push_enum.rb index d872719..1a1b93f 100644 --- a/lib/klaviyo-api-sdk/models/push_enum.rb +++ b/lib/klaviyo-api-sdk/models/push_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object.rb b/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object.rb index ccfc09b..e793064 100644 --- a/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object_attributes.rb index 920f3f0..51befc2 100644 --- a/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/push_profile_upsert_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -36,6 +36,9 @@ class PushProfileUpsertQueryResourceObjectAttributes # Name of the company or organization within the company for whom the individual works attr_accessor :organization + # The locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2) + attr_accessor :locale + # Individual's job title attr_accessor :title @@ -62,6 +65,7 @@ def self.attribute_map :'first_name' => :'first_name', :'last_name' => :'last_name', :'organization' => :'organization', + :'locale' => :'locale', :'title' => :'title', :'image' => :'image', :'location' => :'location', @@ -86,6 +90,7 @@ def self.openapi_types :'first_name' => :'String', :'last_name' => :'String', :'organization' => :'String', + :'locale' => :'String', :'title' => :'String', :'image' => :'String', :'location' => :'ProfileLocation', @@ -105,6 +110,7 @@ def self.openapi_nullable :'first_name', :'last_name', :'organization', + :'locale', :'title', :'image', :'properties', @@ -155,6 +161,10 @@ def initialize(attributes = {}) self.organization = attributes[:'organization'] end + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -205,6 +215,7 @@ def ==(o) first_name == o.first_name && last_name == o.last_name && organization == o.organization && + locale == o.locale && title == o.title && image == o.image && location == o.location && @@ -222,7 +233,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, title, image, location, properties, meta, email].hash + [phone_number, external_id, anonymous_id, _kx, first_name, last_name, organization, locale, title, image, location, properties, meta, email].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/push_token_create_query.rb b/lib/klaviyo-api-sdk/models/push_token_create_query.rb index 47cb187..d912ef8 100644 --- a/lib/klaviyo-api-sdk/models/push_token_create_query.rb +++ b/lib/klaviyo-api-sdk/models/push_token_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object.rb index e445995..d28ce45 100644 --- a/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes.rb index 6c4ebab..9cac041 100644 --- a/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes_profile.rb b/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes_profile.rb index cd7593e..f7d22c4 100644 --- a/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes_profile.rb +++ b/lib/klaviyo-api-sdk/models/push_token_create_query_resource_object_attributes_profile.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/push_token_enum.rb b/lib/klaviyo-api-sdk/models/push_token_enum.rb index 4b7f0d9..2838dc3 100644 --- a/lib/klaviyo-api-sdk/models/push_token_enum.rb +++ b/lib/klaviyo-api-sdk/models/push_token_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/relative_anniversary_date_filter.rb b/lib/klaviyo-api-sdk/models/relative_anniversary_date_filter.rb index 7ab12ab..4c6c4be 100644 --- a/lib/klaviyo-api-sdk/models/relative_anniversary_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/relative_anniversary_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/relative_date_operator_base_filter.rb b/lib/klaviyo-api-sdk/models/relative_date_operator_base_filter.rb index dec6f09..6320575 100644 --- a/lib/klaviyo-api-sdk/models/relative_date_operator_base_filter.rb +++ b/lib/klaviyo-api-sdk/models/relative_date_operator_base_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/relative_date_range_filter.rb b/lib/klaviyo-api-sdk/models/relative_date_range_filter.rb index 454eb95..fc01a89 100644 --- a/lib/klaviyo-api-sdk/models/relative_date_range_filter.rb +++ b/lib/klaviyo-api-sdk/models/relative_date_range_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/render_options_sub_object.rb b/lib/klaviyo-api-sdk/models/render_options_sub_object.rb index 4865001..7f3c03a 100644 --- a/lib/klaviyo-api-sdk/models/render_options_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/render_options_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_create_query.rb b/lib/klaviyo-api-sdk/models/segment_create_query.rb index 147fd46..c254e0e 100644 --- a/lib/klaviyo-api-sdk/models/segment_create_query.rb +++ b/lib/klaviyo-api-sdk/models/segment_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/segment_create_query_resource_object.rb index c03cc2c..5e901a8 100644 --- a/lib/klaviyo-api-sdk/models/segment_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/segment_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/segment_create_query_resource_object_attributes.rb index 47b4237..c2c68ae 100644 --- a/lib/klaviyo-api-sdk/models/segment_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/segment_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_definition.rb b/lib/klaviyo-api-sdk/models/segment_definition.rb index 71a5402..c86c26b 100644 --- a/lib/klaviyo-api-sdk/models/segment_definition.rb +++ b/lib/klaviyo-api-sdk/models/segment_definition.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_enum.rb b/lib/klaviyo-api-sdk/models/segment_enum.rb index b52701f..e14c37b 100644 --- a/lib/klaviyo-api-sdk/models/segment_enum.rb +++ b/lib/klaviyo-api-sdk/models/segment_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb b/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb index 7f2acf5..e9c2599 100644 --- a/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object.rb index 22d062e..173e0e0 100644 --- a/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object_attributes.rb index c26943c..7bb2fcd 100644 --- a/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/segment_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/segment_series_report_enum.rb b/lib/klaviyo-api-sdk/models/segment_series_report_enum.rb new file mode 100644 index 0000000..d390cff --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_series_report_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentSeriesReportEnum + SEGMENT_SERIES_REPORT = "segment-series-report".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SegmentSeriesReportEnum.constants.select { |c| SegmentSeriesReportEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SegmentSeriesReportEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/segment_series_request_dto.rb b/lib/klaviyo-api-sdk/models/segment_series_request_dto.rb new file mode 100644 index 0000000..4ab1165 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_series_request_dto.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentSeriesRequestDTO + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'SegmentSeriesRequestDTOResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SegmentSeriesRequestDTO` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SegmentSeriesRequestDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/segment_series_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/segment_series_request_dto_resource_object.rb new file mode 100644 index 0000000..a2e0ad7 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_series_request_dto_resource_object.rb @@ -0,0 +1,238 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentSeriesRequestDTOResourceObject + attr_accessor :type + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'SegmentSeriesReportEnum', + :'attributes' => :'SegmentSeriesRequestDTOResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SegmentSeriesRequestDTOResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SegmentSeriesRequestDTOResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/segment_series_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/segment_series_request_dto_resource_object_attributes.rb new file mode 100644 index 0000000..c643dbd --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_series_request_dto_resource_object_attributes.rb @@ -0,0 +1,301 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentSeriesRequestDTOResourceObjectAttributes + # List of statistics to query for. + attr_accessor :statistics + + attr_accessor :timeframe + + # The interval used to aggregate data within the series request. If hourly is used, the timeframe cannot be longer than 7 days. If daily is used, the timeframe cannot be longer than 60 days. If monthly is used, the timeframe cannot be longer than 52 weeks. + attr_accessor :interval + + # API filter string used to filter the query. Allowed filters are segment_id. Allowed operators are equals, any. Only one filter can be used per attribute. Max of 100 messages per ANY filter. + attr_accessor :filter + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statistics' => :'statistics', + :'timeframe' => :'timeframe', + :'interval' => :'interval', + :'filter' => :'filter' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'statistics' => :'Array', + :'timeframe' => :'SegmentValuesRequestDTOResourceObjectAttributesTimeframe', + :'interval' => :'String', + :'filter' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'filter' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SegmentSeriesRequestDTOResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SegmentSeriesRequestDTOResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statistics') + if (value = attributes[:'statistics']).is_a?(Array) + self.statistics = value + end + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + if @timeframe.nil? + invalid_properties.push('invalid value for "timeframe", timeframe cannot be nil.') + end + + if @interval.nil? + invalid_properties.push('invalid value for "interval", interval cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @statistics.nil? + return false if @timeframe.nil? + return false if @interval.nil? + interval_validator = EnumAttributeValidator.new('String', ["daily", "hourly", "monthly", "weekly"]) + return false unless interval_validator.valid?(@interval) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] interval Object to be assigned + def interval=(interval) + validator = EnumAttributeValidator.new('String', ["daily", "hourly", "monthly", "weekly"]) + unless validator.valid?(interval) + fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}." + end + @interval = interval + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statistics == o.statistics && + timeframe == o.timeframe && + interval == o.interval && + filter == o.filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statistics, timeframe, interval, filter].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/segment_values_report_enum.rb b/lib/klaviyo-api-sdk/models/segment_values_report_enum.rb new file mode 100644 index 0000000..190e8b6 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_values_report_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentValuesReportEnum + SEGMENT_VALUES_REPORT = "segment-values-report".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SegmentValuesReportEnum.constants.select { |c| SegmentValuesReportEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SegmentValuesReportEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/segment_values_request_dto.rb b/lib/klaviyo-api-sdk/models/segment_values_request_dto.rb new file mode 100644 index 0000000..7922a4c --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_values_request_dto.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentValuesRequestDTO + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'SegmentValuesRequestDTOResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SegmentValuesRequestDTO` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SegmentValuesRequestDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object.rb b/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object.rb new file mode 100644 index 0000000..db2cc8f --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object.rb @@ -0,0 +1,238 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentValuesRequestDTOResourceObject + attr_accessor :type + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'SegmentValuesReportEnum', + :'attributes' => :'SegmentValuesRequestDTOResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SegmentValuesRequestDTOResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SegmentValuesRequestDTOResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes.rb new file mode 100644 index 0000000..6f85149 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes.rb @@ -0,0 +1,274 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class SegmentValuesRequestDTOResourceObjectAttributes + # List of statistics to query for. + attr_accessor :statistics + + attr_accessor :timeframe + + # API filter string used to filter the query. Allowed filters are segment_id. Allowed operators are equals, any. Only one filter can be used per attribute. Max of 100 messages per ANY filter. + attr_accessor :filter + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statistics' => :'statistics', + :'timeframe' => :'timeframe', + :'filter' => :'filter' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'statistics' => :'Array', + :'timeframe' => :'SegmentValuesRequestDTOResourceObjectAttributesTimeframe', + :'filter' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'filter' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SegmentValuesRequestDTOResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SegmentValuesRequestDTOResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statistics') + if (value = attributes[:'statistics']).is_a?(Array) + self.statistics = value + end + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + if @timeframe.nil? + invalid_properties.push('invalid value for "timeframe", timeframe cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @statistics.nil? + return false if @timeframe.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statistics == o.statistics && + timeframe == o.timeframe && + filter == o.filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statistics, timeframe, filter].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes_timeframe.rb b/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes_timeframe.rb new file mode 100644 index 0000000..118b676 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/segment_values_request_dto_resource_object_attributes_timeframe.rb @@ -0,0 +1,106 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + # The timeframe to query for data within. Data is unavailable before June 1st, 2023. Please use a timeframe after this date. The max length a timeframe can be is 1 year + module SegmentValuesRequestDTOResourceObjectAttributesTimeframe + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CustomTimeframe', + :'Timeframe' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = KlaviyoAPI.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/klaviyo-api-sdk/models/send_strategy_sub_object.rb b/lib/klaviyo-api-sdk/models/send_strategy_sub_object.rb index ca56611..2d9e71a 100644 --- a/lib/klaviyo-api-sdk/models/send_strategy_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/send_strategy_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query.rb index f287689..671da39 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object.rb index b9ce5c0..84da02e 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes.rb index 8856cf7..7e878fa 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes_profile.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes_profile.rb index eb7f8f4..c38cd2c 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes_profile.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_attributes_profile.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships.rb index 27bd14a..dd0672b 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant.rb index c42c86d..44b6e7e 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant_data.rb b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant_data.rb index 8c72adf..7312415 100644 --- a/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant_data.rb +++ b/lib/klaviyo-api-sdk/models/server_bis_subscription_create_query_resource_object_relationships_variant_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sftp_enum.rb b/lib/klaviyo-api-sdk/models/sftp_enum.rb index e14e240..7cf0c55 100644 --- a/lib/klaviyo-api-sdk/models/sftp_enum.rb +++ b/lib/klaviyo-api-sdk/models/sftp_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sftp_method_filter.rb b/lib/klaviyo-api-sdk/models/sftp_method_filter.rb index 7a9992d..98071db 100644 --- a/lib/klaviyo-api-sdk/models/sftp_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/sftp_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/shopify_enum.rb b/lib/klaviyo-api-sdk/models/shopify_enum.rb index 50af5ab..5b9fdfc 100644 --- a/lib/klaviyo-api-sdk/models/shopify_enum.rb +++ b/lib/klaviyo-api-sdk/models/shopify_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/shopify_integration_filter.rb b/lib/klaviyo-api-sdk/models/shopify_integration_filter.rb index d584084..3692ae4 100644 --- a/lib/klaviyo-api-sdk/models/shopify_integration_filter.rb +++ b/lib/klaviyo-api-sdk/models/shopify_integration_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/shopify_integration_method_filter.rb b/lib/klaviyo-api-sdk/models/shopify_integration_method_filter.rb index bf675d9..07a6012 100644 --- a/lib/klaviyo-api-sdk/models/shopify_integration_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/shopify_integration_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sms_content_sub_object_create.rb b/lib/klaviyo-api-sdk/models/sms_content_sub_object_create.rb index 21cd806..475e916 100644 --- a/lib/klaviyo-api-sdk/models/sms_content_sub_object_create.rb +++ b/lib/klaviyo-api-sdk/models/sms_content_sub_object_create.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sms_enum.rb b/lib/klaviyo-api-sdk/models/sms_enum.rb index b2296cd..8824da5 100644 --- a/lib/klaviyo-api-sdk/models/sms_enum.rb +++ b/lib/klaviyo-api-sdk/models/sms_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sms_send_options_sub_object.rb b/lib/klaviyo-api-sdk/models/sms_send_options_sub_object.rb index 7ce5549..12a3666 100644 --- a/lib/klaviyo-api-sdk/models/sms_send_options_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/sms_send_options_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb b/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb index 8075d35..c233a82 100644 --- a/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb +++ b/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -32,7 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'marketing' => :'MarketingSubscriptionParameters' + :'marketing' => :'SubscriptionParameters' } end @@ -66,17 +66,12 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @marketing.nil? - invalid_properties.push('invalid value for "marketing", marketing cannot be nil.') - end - invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @marketing.nil? true end diff --git a/lib/klaviyo-api-sdk/models/sms_tracking_options_sub_object.rb b/lib/klaviyo-api-sdk/models/sms_tracking_options_sub_object.rb index 6975513..d9feed4 100644 --- a/lib/klaviyo-api-sdk/models/sms_tracking_options_sub_object.rb +++ b/lib/klaviyo-api-sdk/models/sms_tracking_options_sub_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -15,17 +15,17 @@ module KlaviyoAPI class SMSTrackingOptionsSubObject - # Whether the campaign needs UTM parameters. If set to False, UTM params will not be used. - attr_accessor :is_add_utm + # Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used. + attr_accessor :add_tracking_params - # A list of UTM parameters. If an empty list is given and is_add_utm is True, uses company defaults. - attr_accessor :utm_params + # A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults. + attr_accessor :custom_tracking_params # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'is_add_utm' => :'is_add_utm', - :'utm_params' => :'utm_params' + :'add_tracking_params' => :'add_tracking_params', + :'custom_tracking_params' => :'custom_tracking_params' } end @@ -37,16 +37,16 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'is_add_utm' => :'Boolean', - :'utm_params' => :'Array' + :'add_tracking_params' => :'Boolean', + :'custom_tracking_params' => :'Array' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'is_add_utm', - :'utm_params' + :'add_tracking_params', + :'custom_tracking_params' ]) end @@ -65,13 +65,13 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'is_add_utm') - self.is_add_utm = attributes[:'is_add_utm'] + if attributes.key?(:'add_tracking_params') + self.add_tracking_params = attributes[:'add_tracking_params'] end - if attributes.key?(:'utm_params') - if (value = attributes[:'utm_params']).is_a?(Array) - self.utm_params = value + if attributes.key?(:'custom_tracking_params') + if (value = attributes[:'custom_tracking_params']).is_a?(Array) + self.custom_tracking_params = value end end end @@ -94,8 +94,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - is_add_utm == o.is_add_utm && - utm_params == o.utm_params + add_tracking_params == o.add_tracking_params && + custom_tracking_params == o.custom_tracking_params end # @see the `==` method @@ -107,7 +107,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [is_add_utm, utm_params].hash + [add_tracking_params, custom_tracking_params].hash end # Builds the object from hash diff --git a/lib/klaviyo-api-sdk/models/spam_complaint_enum.rb b/lib/klaviyo-api-sdk/models/spam_complaint_enum.rb index 8ecc996..eb2d1c5 100644 --- a/lib/klaviyo-api-sdk/models/spam_complaint_enum.rb +++ b/lib/klaviyo-api-sdk/models/spam_complaint_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/spam_complaint_method_filter.rb b/lib/klaviyo-api-sdk/models/spam_complaint_method_filter.rb index e9fa4aa..bf1f189 100644 --- a/lib/klaviyo-api-sdk/models/spam_complaint_method_filter.rb +++ b/lib/klaviyo-api-sdk/models/spam_complaint_method_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/static_date_filter.rb b/lib/klaviyo-api-sdk/models/static_date_filter.rb index c01a839..1118dbe 100644 --- a/lib/klaviyo-api-sdk/models/static_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/static_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/static_date_range_filter.rb b/lib/klaviyo-api-sdk/models/static_date_range_filter.rb index b3c7f70..ab22f3d 100644 --- a/lib/klaviyo-api-sdk/models/static_date_range_filter.rb +++ b/lib/klaviyo-api-sdk/models/static_date_range_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/static_enum.rb b/lib/klaviyo-api-sdk/models/static_enum.rb new file mode 100644 index 0000000..f215399 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/static_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class StaticEnum + STATIC = "static".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = StaticEnum.constants.select { |c| StaticEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #StaticEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/static_schedule_options.rb b/lib/klaviyo-api-sdk/models/static_schedule_options.rb index 73156c4..710d74a 100644 --- a/lib/klaviyo-api-sdk/models/static_schedule_options.rb +++ b/lib/klaviyo-api-sdk/models/static_schedule_options.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/static_tracking_param.rb b/lib/klaviyo-api-sdk/models/static_tracking_param.rb new file mode 100644 index 0000000..91bafa0 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/static_tracking_param.rb @@ -0,0 +1,254 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class StaticTrackingParam + attr_accessor :type + + # The value of the tracking parameter + attr_accessor :value + + # Name of the tracking param + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'value' => :'value', + :'name' => :'name' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'StaticEnum', + :'value' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::StaticTrackingParam` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::StaticTrackingParam`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @value.nil? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + value == o.value && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, value, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/status_date_enum.rb b/lib/klaviyo-api-sdk/models/status_date_enum.rb index 9ab5446..c053e4f 100644 --- a/lib/klaviyo-api-sdk/models/status_date_enum.rb +++ b/lib/klaviyo-api-sdk/models/status_date_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/status_date_filter.rb b/lib/klaviyo-api-sdk/models/status_date_filter.rb index 237ee07..d616079 100644 --- a/lib/klaviyo-api-sdk/models/status_date_filter.rb +++ b/lib/klaviyo-api-sdk/models/status_date_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/status_date_filter_filter.rb b/lib/klaviyo-api-sdk/models/status_date_filter_filter.rb index 93cd89f..e94dd4c 100644 --- a/lib/klaviyo-api-sdk/models/status_date_filter_filter.rb +++ b/lib/klaviyo-api-sdk/models/status_date_filter_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/sto_schedule_options.rb b/lib/klaviyo-api-sdk/models/sto_schedule_options.rb index e363536..3eeae5f 100644 --- a/lib/klaviyo-api-sdk/models/sto_schedule_options.rb +++ b/lib/klaviyo-api-sdk/models/sto_schedule_options.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/string_array_operator_filter.rb b/lib/klaviyo-api-sdk/models/string_array_operator_filter.rb index 249e019..0d1b2b9 100644 --- a/lib/klaviyo-api-sdk/models/string_array_operator_filter.rb +++ b/lib/klaviyo-api-sdk/models/string_array_operator_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/string_enum.rb b/lib/klaviyo-api-sdk/models/string_enum.rb index f029213..e405a32 100644 --- a/lib/klaviyo-api-sdk/models/string_enum.rb +++ b/lib/klaviyo-api-sdk/models/string_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/string_operator_filter.rb b/lib/klaviyo-api-sdk/models/string_operator_filter.rb index a506b0c..1c0cad2 100644 --- a/lib/klaviyo-api-sdk/models/string_operator_filter.rb +++ b/lib/klaviyo-api-sdk/models/string_operator_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/string_phone_operator_array_filter.rb b/lib/klaviyo-api-sdk/models/string_phone_operator_array_filter.rb index ad88ebf..b233bde 100644 --- a/lib/klaviyo-api-sdk/models/string_phone_operator_array_filter.rb +++ b/lib/klaviyo-api-sdk/models/string_phone_operator_array_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscribed_enum.rb b/lib/klaviyo-api-sdk/models/subscribed_enum.rb index 06cb2ab..dede174 100644 --- a/lib/klaviyo-api-sdk/models/subscribed_enum.rb +++ b/lib/klaviyo-api-sdk/models/subscribed_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_channels.rb b/lib/klaviyo-api-sdk/models/subscription_channels.rb index 226a17a..722c85d 100644 --- a/lib/klaviyo-api-sdk/models/subscription_channels.rb +++ b/lib/klaviyo-api-sdk/models/subscription_channels.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb index c66b1f1..cdec170 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object.rb index 90ad3f2..c2916f7 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes.rb index f614d52..437c518 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes_profiles.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes_profiles.rb index ab5ca08..72dd5ed 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes_profiles.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_attributes_profiles.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships.rb index cdb967d..a71d5f0 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list.rb index 5d57c26..5d6a38d 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list_data.rb b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list_data.rb index feb58d0..d596ae6 100644 --- a/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list_data.rb +++ b/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_resource_object_relationships_list_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query.rb index b9b8d7a..91d3c7e 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object.rb index c2a29cf..163784d 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes.rb index 96450ce..7085ec3 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes_profiles.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes_profiles.rb index 8bb78c9..5850cea 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes_profiles.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_attributes_profiles.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships.rb index 9e7eb4c..1e4a235 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list.rb index 3618bf6..4b6741b 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list_data.rb b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list_data.rb index 002004b..1dde1b8 100644 --- a/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list_data.rb +++ b/lib/klaviyo-api-sdk/models/subscription_delete_job_create_query_resource_object_relationships_list_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/marketing_subscription_parameters.rb b/lib/klaviyo-api-sdk/models/subscription_parameters.rb similarity index 94% rename from lib/klaviyo-api-sdk/models/marketing_subscription_parameters.rb rename to lib/klaviyo-api-sdk/models/subscription_parameters.rb index c658c5e..ec29a31 100644 --- a/lib/klaviyo-api-sdk/models/marketing_subscription_parameters.rb +++ b/lib/klaviyo-api-sdk/models/subscription_parameters.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 @@ -14,8 +14,8 @@ require 'time' module KlaviyoAPI - class MarketingSubscriptionParameters - # The Consent status to subscribe to for the \"Marketing\" type. Currently supports \"SUBSCRIBED\". + class SubscriptionParameters + # The Consent status to be set as part of the subscribe call. Currently supports \"SUBSCRIBED\". attr_accessor :consent # The timestamp of when the profile's consent was gathered. This should only be used when syncing over historical consent info to Klaviyo; if the `historical_import` flag is not included, providing any value for this field will raise an error. @@ -75,13 +75,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::MarketingSubscriptionParameters` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::SubscriptionParameters` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::MarketingSubscriptionParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::SubscriptionParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb index d4086c7..652d2e7 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object.rb index 7d4de3c..0e0db9a 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes.rb index 67859d8..727d495 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes_profiles.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes_profiles.rb index 13d48a6..12c0e61 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes_profiles.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_attributes_profiles.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships.rb index 363a8fd..e9e441c 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list.rb index de3050f..c8b7b6c 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list_data.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list_data.rb index 33590c8..876f5bf 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list_data.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_list_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment.rb index ad2fe53..a44b13f 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment_data.rb b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment_data.rb index 4116a0b..985afe5 100644 --- a/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment_data.rb +++ b/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_resource_object_relationships_segment_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query.rb index 5571fcc..4330551 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object.rb index 5f17377..b7d19a8 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes.rb index c2f0cf7..1d17d19 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes_profiles.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes_profiles.rb index 93b3aca..51460aa 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes_profiles.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_attributes_profiles.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships.rb index 76dec78..7d24c1d 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list.rb index 48360c7..c74f186 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list_data.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list_data.rb index 2963838..f0dbd7a 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list_data.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_list_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment.rb index e7799f1..2d20287 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment_data.rb b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment_data.rb index 7dd40ea..865f4c2 100644 --- a/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment_data.rb +++ b/lib/klaviyo-api-sdk/models/suppression_delete_job_create_query_resource_object_relationships_segment_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_campaign_op.rb b/lib/klaviyo-api-sdk/models/tag_campaign_op.rb index 2ee0599..5196cf4 100644 --- a/lib/klaviyo-api-sdk/models/tag_campaign_op.rb +++ b/lib/klaviyo-api-sdk/models/tag_campaign_op.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_campaign_op_data_inner.rb b/lib/klaviyo-api-sdk/models/tag_campaign_op_data_inner.rb index 5f0fddf..602e317 100644 --- a/lib/klaviyo-api-sdk/models/tag_campaign_op_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/tag_campaign_op_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_create_query.rb b/lib/klaviyo-api-sdk/models/tag_create_query.rb index 1caaa08..e31311d 100644 --- a/lib/klaviyo-api-sdk/models/tag_create_query.rb +++ b/lib/klaviyo-api-sdk/models/tag_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object.rb index 377ddfe..f777708 100644 --- a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_attributes.rb index bfbca5b..65ebf3d 100644 --- a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships.rb index c08f103..d19d4b4 100644 --- a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group.rb b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group.rb index ae063bb..bb42c4a 100644 --- a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group.rb +++ b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group_data.rb b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group_data.rb index 3c28cae..ed8812f 100644 --- a/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group_data.rb +++ b/lib/klaviyo-api-sdk/models/tag_create_query_resource_object_relationships_tag_group_data.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_enum.rb b/lib/klaviyo-api-sdk/models/tag_enum.rb index aaae1b4..0eccfee 100644 --- a/lib/klaviyo-api-sdk/models/tag_enum.rb +++ b/lib/klaviyo-api-sdk/models/tag_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_flow_op.rb b/lib/klaviyo-api-sdk/models/tag_flow_op.rb index e1fc96e..eb0ff09 100644 --- a/lib/klaviyo-api-sdk/models/tag_flow_op.rb +++ b/lib/klaviyo-api-sdk/models/tag_flow_op.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_flow_op_data_inner.rb b/lib/klaviyo-api-sdk/models/tag_flow_op_data_inner.rb index 189ba77..d1935ae 100644 --- a/lib/klaviyo-api-sdk/models/tag_flow_op_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/tag_flow_op_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_create_query.rb b/lib/klaviyo-api-sdk/models/tag_group_create_query.rb index 2b6c0a8..edd6de4 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_create_query.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object.rb index 92baffd..6bb81c8 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object_attributes.rb index 457203f..b807b67 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_enum.rb b/lib/klaviyo-api-sdk/models/tag_group_enum.rb index ea47e44..5971b0a 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_enum.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_update_query.rb b/lib/klaviyo-api-sdk/models/tag_group_update_query.rb index 642bb4c..65f790b 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_update_query.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object.rb index f3880b2..5ff28b1 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object_attributes.rb index 290d18b..2751917 100644 --- a/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/tag_group_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_list_op.rb b/lib/klaviyo-api-sdk/models/tag_list_op.rb index 943c7b4..19d4506 100644 --- a/lib/klaviyo-api-sdk/models/tag_list_op.rb +++ b/lib/klaviyo-api-sdk/models/tag_list_op.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_list_op_data_inner.rb b/lib/klaviyo-api-sdk/models/tag_list_op_data_inner.rb index ffb7ab0..b72011b 100644 --- a/lib/klaviyo-api-sdk/models/tag_list_op_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/tag_list_op_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_segment_op.rb b/lib/klaviyo-api-sdk/models/tag_segment_op.rb index c771ed0..b7b1120 100644 --- a/lib/klaviyo-api-sdk/models/tag_segment_op.rb +++ b/lib/klaviyo-api-sdk/models/tag_segment_op.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_segment_op_data_inner.rb b/lib/klaviyo-api-sdk/models/tag_segment_op_data_inner.rb index a36f1cf..c5f718b 100644 --- a/lib/klaviyo-api-sdk/models/tag_segment_op_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/tag_segment_op_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_update_query.rb b/lib/klaviyo-api-sdk/models/tag_update_query.rb index d623d23..0655c41 100644 --- a/lib/klaviyo-api-sdk/models/tag_update_query.rb +++ b/lib/klaviyo-api-sdk/models/tag_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tag_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/tag_update_query_resource_object.rb index 7307c96..7767809 100644 --- a/lib/klaviyo-api-sdk/models/tag_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/tag_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_clone_query.rb b/lib/klaviyo-api-sdk/models/template_clone_query.rb index 77ec4cd..ceb06e6 100644 --- a/lib/klaviyo-api-sdk/models/template_clone_query.rb +++ b/lib/klaviyo-api-sdk/models/template_clone_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_clone_query_resource_object.rb b/lib/klaviyo-api-sdk/models/template_clone_query_resource_object.rb index 0e65e03..0598f4c 100644 --- a/lib/klaviyo-api-sdk/models/template_clone_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/template_clone_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_clone_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/template_clone_query_resource_object_attributes.rb index f1b26f9..6b5e0dd 100644 --- a/lib/klaviyo-api-sdk/models/template_clone_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/template_clone_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_create_query.rb b/lib/klaviyo-api-sdk/models/template_create_query.rb index cc4ae31..4ed2313 100644 --- a/lib/klaviyo-api-sdk/models/template_create_query.rb +++ b/lib/klaviyo-api-sdk/models/template_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/template_create_query_resource_object.rb index 7cc7bc9..b842007 100644 --- a/lib/klaviyo-api-sdk/models/template_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/template_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb index 2bba7b6..8b89fa1 100644 --- a/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_enum.rb b/lib/klaviyo-api-sdk/models/template_enum.rb index 4655a6c..f0cc3a8 100644 --- a/lib/klaviyo-api-sdk/models/template_enum.rb +++ b/lib/klaviyo-api-sdk/models/template_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_render_query.rb b/lib/klaviyo-api-sdk/models/template_render_query.rb index aacb9ac..7665624 100644 --- a/lib/klaviyo-api-sdk/models/template_render_query.rb +++ b/lib/klaviyo-api-sdk/models/template_render_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_render_query_resource_object.rb b/lib/klaviyo-api-sdk/models/template_render_query_resource_object.rb index ea3f1cb..635024e 100644 --- a/lib/klaviyo-api-sdk/models/template_render_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/template_render_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_render_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/template_render_query_resource_object_attributes.rb index 8efee95..296b6bc 100644 --- a/lib/klaviyo-api-sdk/models/template_render_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/template_render_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_universal_content_enum.rb b/lib/klaviyo-api-sdk/models/template_universal_content_enum.rb new file mode 100644 index 0000000..61a67de --- /dev/null +++ b/lib/klaviyo-api-sdk/models/template_universal_content_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TemplateUniversalContentEnum + TEMPLATE_UNIVERSAL_CONTENT = "template-universal-content".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TemplateUniversalContentEnum.constants.select { |c| TemplateUniversalContentEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TemplateUniversalContentEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/template_update_query.rb b/lib/klaviyo-api-sdk/models/template_update_query.rb index 96e171d..6922918 100644 --- a/lib/klaviyo-api-sdk/models/template_update_query.rb +++ b/lib/klaviyo-api-sdk/models/template_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/template_update_query_resource_object.rb index 2ecf01c..1d81b69 100644 --- a/lib/klaviyo-api-sdk/models/template_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/template_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/template_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/template_update_query_resource_object_attributes.rb index e412ee4..df2d818 100644 --- a/lib/klaviyo-api-sdk/models/template_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/template_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/text_block.rb b/lib/klaviyo-api-sdk/models/text_block.rb new file mode 100644 index 0000000..7bc770b --- /dev/null +++ b/lib/klaviyo-api-sdk/models/text_block.rb @@ -0,0 +1,252 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TextBlock + attr_accessor :content_type + + attr_accessor :type + + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'content_type' => :'content_type', + :'type' => :'type', + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'content_type' => :'BlockEnum', + :'type' => :'TextEnum', + :'data' => :'TextBlockData' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TextBlock` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TextBlock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @content_type.nil? + invalid_properties.push('invalid value for "content_type", content_type cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @content_type.nil? + return false if @type.nil? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content_type == o.content_type && + type == o.type && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [content_type, type, data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/text_block_data.rb b/lib/klaviyo-api-sdk/models/text_block_data.rb new file mode 100644 index 0000000..8ae6c26 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/text_block_data.rb @@ -0,0 +1,252 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TextBlockData + attr_accessor :content + + attr_accessor :display_options + + attr_accessor :styles + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'content' => :'content', + :'display_options' => :'display_options', + :'styles' => :'styles' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'content' => :'String', + :'display_options' => :'BlockDisplayOptions', + :'styles' => :'TextBlockStyles' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TextBlockData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TextBlockData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'display_options') + self.display_options = attributes[:'display_options'] + end + + if attributes.key?(:'styles') + self.styles = attributes[:'styles'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @content.nil? + invalid_properties.push('invalid value for "content", content cannot be nil.') + end + + if @display_options.nil? + invalid_properties.push('invalid value for "display_options", display_options cannot be nil.') + end + + if @styles.nil? + invalid_properties.push('invalid value for "styles", styles cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @content.nil? + return false if @display_options.nil? + return false if @styles.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + display_options == o.display_options && + styles == o.styles + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [content, display_options, styles].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/text_block_styles.rb b/lib/klaviyo-api-sdk/models/text_block_styles.rb new file mode 100644 index 0000000..8115abc --- /dev/null +++ b/lib/klaviyo-api-sdk/models/text_block_styles.rb @@ -0,0 +1,534 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TextBlockStyles + attr_accessor :block_background_color + + attr_accessor :block_border_color + + # Border style. + attr_accessor :block_border_style + + attr_accessor :block_border_width + + attr_accessor :block_padding_bottom + + attr_accessor :block_padding_left + + attr_accessor :block_padding_right + + attr_accessor :block_padding_top + + attr_accessor :color + + attr_accessor :extra_css_class + + attr_accessor :font_family + + attr_accessor :font_size + + # Font style. + attr_accessor :font_style + + attr_accessor :font_weight + + attr_accessor :inner_padding_bottom + + attr_accessor :inner_padding_left + + attr_accessor :inner_padding_right + + attr_accessor :inner_padding_top + + attr_accessor :mobile_stretch_content + + attr_accessor :background_color + + attr_accessor :letter_spacing + + attr_accessor :line_height + + # Text Alignment. + attr_accessor :text_align + + attr_accessor :text_decoration + + # Text table layout. + attr_accessor :text_table_layout + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'block_background_color' => :'block_background_color', + :'block_border_color' => :'block_border_color', + :'block_border_style' => :'block_border_style', + :'block_border_width' => :'block_border_width', + :'block_padding_bottom' => :'block_padding_bottom', + :'block_padding_left' => :'block_padding_left', + :'block_padding_right' => :'block_padding_right', + :'block_padding_top' => :'block_padding_top', + :'color' => :'color', + :'extra_css_class' => :'extra_css_class', + :'font_family' => :'font_family', + :'font_size' => :'font_size', + :'font_style' => :'font_style', + :'font_weight' => :'font_weight', + :'inner_padding_bottom' => :'inner_padding_bottom', + :'inner_padding_left' => :'inner_padding_left', + :'inner_padding_right' => :'inner_padding_right', + :'inner_padding_top' => :'inner_padding_top', + :'mobile_stretch_content' => :'mobile_stretch_content', + :'background_color' => :'background_color', + :'letter_spacing' => :'letter_spacing', + :'line_height' => :'line_height', + :'text_align' => :'text_align', + :'text_decoration' => :'text_decoration', + :'text_table_layout' => :'text_table_layout' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'block_background_color' => :'String', + :'block_border_color' => :'String', + :'block_border_style' => :'String', + :'block_border_width' => :'Integer', + :'block_padding_bottom' => :'Integer', + :'block_padding_left' => :'Integer', + :'block_padding_right' => :'Integer', + :'block_padding_top' => :'Integer', + :'color' => :'String', + :'extra_css_class' => :'String', + :'font_family' => :'String', + :'font_size' => :'Integer', + :'font_style' => :'String', + :'font_weight' => :'String', + :'inner_padding_bottom' => :'Integer', + :'inner_padding_left' => :'Integer', + :'inner_padding_right' => :'Integer', + :'inner_padding_top' => :'Integer', + :'mobile_stretch_content' => :'Boolean', + :'background_color' => :'String', + :'letter_spacing' => :'Integer', + :'line_height' => :'Float', + :'text_align' => :'String', + :'text_decoration' => :'String', + :'text_table_layout' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'block_background_color', + :'block_border_color', + :'block_border_style', + :'block_border_width', + :'block_padding_bottom', + :'block_padding_left', + :'block_padding_right', + :'block_padding_top', + :'color', + :'extra_css_class', + :'font_family', + :'font_size', + :'font_style', + :'font_weight', + :'inner_padding_bottom', + :'inner_padding_left', + :'inner_padding_right', + :'inner_padding_top', + :'mobile_stretch_content', + :'background_color', + :'letter_spacing', + :'line_height', + :'text_align', + :'text_decoration', + :'text_table_layout' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TextBlockStyles` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TextBlockStyles`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'block_background_color') + self.block_background_color = attributes[:'block_background_color'] + end + + if attributes.key?(:'block_border_color') + self.block_border_color = attributes[:'block_border_color'] + end + + if attributes.key?(:'block_border_style') + self.block_border_style = attributes[:'block_border_style'] + end + + if attributes.key?(:'block_border_width') + self.block_border_width = attributes[:'block_border_width'] + end + + if attributes.key?(:'block_padding_bottom') + self.block_padding_bottom = attributes[:'block_padding_bottom'] + end + + if attributes.key?(:'block_padding_left') + self.block_padding_left = attributes[:'block_padding_left'] + end + + if attributes.key?(:'block_padding_right') + self.block_padding_right = attributes[:'block_padding_right'] + end + + if attributes.key?(:'block_padding_top') + self.block_padding_top = attributes[:'block_padding_top'] + end + + if attributes.key?(:'color') + self.color = attributes[:'color'] + end + + if attributes.key?(:'extra_css_class') + self.extra_css_class = attributes[:'extra_css_class'] + end + + if attributes.key?(:'font_family') + self.font_family = attributes[:'font_family'] + end + + if attributes.key?(:'font_size') + self.font_size = attributes[:'font_size'] + end + + if attributes.key?(:'font_style') + self.font_style = attributes[:'font_style'] + end + + if attributes.key?(:'font_weight') + self.font_weight = attributes[:'font_weight'] + end + + if attributes.key?(:'inner_padding_bottom') + self.inner_padding_bottom = attributes[:'inner_padding_bottom'] + end + + if attributes.key?(:'inner_padding_left') + self.inner_padding_left = attributes[:'inner_padding_left'] + end + + if attributes.key?(:'inner_padding_right') + self.inner_padding_right = attributes[:'inner_padding_right'] + end + + if attributes.key?(:'inner_padding_top') + self.inner_padding_top = attributes[:'inner_padding_top'] + end + + if attributes.key?(:'mobile_stretch_content') + self.mobile_stretch_content = attributes[:'mobile_stretch_content'] + end + + if attributes.key?(:'background_color') + self.background_color = attributes[:'background_color'] + end + + if attributes.key?(:'letter_spacing') + self.letter_spacing = attributes[:'letter_spacing'] + end + + if attributes.key?(:'line_height') + self.line_height = attributes[:'line_height'] + end + + if attributes.key?(:'text_align') + self.text_align = attributes[:'text_align'] + end + + if attributes.key?(:'text_decoration') + self.text_decoration = attributes[:'text_decoration'] + end + + if attributes.key?(:'text_table_layout') + self.text_table_layout = attributes[:'text_table_layout'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + block_border_style_validator = EnumAttributeValidator.new('String', ["dashed", "dotted", "groove", "inset", "none", "outset", "ridge", "solid"]) + return false unless block_border_style_validator.valid?(@block_border_style) + font_style_validator = EnumAttributeValidator.new('String', ["italic", "normal"]) + return false unless font_style_validator.valid?(@font_style) + text_align_validator = EnumAttributeValidator.new('String', ["center", "left", "right"]) + return false unless text_align_validator.valid?(@text_align) + text_table_layout_validator = EnumAttributeValidator.new('String', ["auto", "fixed", "inherit", "initial"]) + return false unless text_table_layout_validator.valid?(@text_table_layout) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] block_border_style Object to be assigned + def block_border_style=(block_border_style) + validator = EnumAttributeValidator.new('String', ["dashed", "dotted", "groove", "inset", "none", "outset", "ridge", "solid"]) + unless validator.valid?(block_border_style) + fail ArgumentError, "invalid value for \"block_border_style\", must be one of #{validator.allowable_values}." + end + @block_border_style = block_border_style + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] font_style Object to be assigned + def font_style=(font_style) + validator = EnumAttributeValidator.new('String', ["italic", "normal"]) + unless validator.valid?(font_style) + fail ArgumentError, "invalid value for \"font_style\", must be one of #{validator.allowable_values}." + end + @font_style = font_style + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] text_align Object to be assigned + def text_align=(text_align) + validator = EnumAttributeValidator.new('String', ["center", "left", "right"]) + unless validator.valid?(text_align) + fail ArgumentError, "invalid value for \"text_align\", must be one of #{validator.allowable_values}." + end + @text_align = text_align + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] text_table_layout Object to be assigned + def text_table_layout=(text_table_layout) + validator = EnumAttributeValidator.new('String', ["auto", "fixed", "inherit", "initial"]) + unless validator.valid?(text_table_layout) + fail ArgumentError, "invalid value for \"text_table_layout\", must be one of #{validator.allowable_values}." + end + @text_table_layout = text_table_layout + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + block_background_color == o.block_background_color && + block_border_color == o.block_border_color && + block_border_style == o.block_border_style && + block_border_width == o.block_border_width && + block_padding_bottom == o.block_padding_bottom && + block_padding_left == o.block_padding_left && + block_padding_right == o.block_padding_right && + block_padding_top == o.block_padding_top && + color == o.color && + extra_css_class == o.extra_css_class && + font_family == o.font_family && + font_size == o.font_size && + font_style == o.font_style && + font_weight == o.font_weight && + inner_padding_bottom == o.inner_padding_bottom && + inner_padding_left == o.inner_padding_left && + inner_padding_right == o.inner_padding_right && + inner_padding_top == o.inner_padding_top && + mobile_stretch_content == o.mobile_stretch_content && + background_color == o.background_color && + letter_spacing == o.letter_spacing && + line_height == o.line_height && + text_align == o.text_align && + text_decoration == o.text_decoration && + text_table_layout == o.text_table_layout + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [block_background_color, block_border_color, block_border_style, block_border_width, block_padding_bottom, block_padding_left, block_padding_right, block_padding_top, color, extra_css_class, font_family, font_size, font_style, font_weight, inner_padding_bottom, inner_padding_left, inner_padding_right, inner_padding_top, mobile_stretch_content, background_color, letter_spacing, line_height, text_align, text_decoration, text_table_layout].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/text_enum.rb b/lib/klaviyo-api-sdk/models/text_enum.rb new file mode 100644 index 0000000..a90a8d7 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/text_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TextEnum + TEXT = "text".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TextEnum.constants.select { |c| TextEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TextEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/throttled_schedule_options.rb b/lib/klaviyo-api-sdk/models/throttled_schedule_options.rb index 3f38d41..4054612 100644 --- a/lib/klaviyo-api-sdk/models/throttled_schedule_options.rb +++ b/lib/klaviyo-api-sdk/models/throttled_schedule_options.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/timeframe.rb b/lib/klaviyo-api-sdk/models/timeframe.rb index c2c7073..f182f3e 100644 --- a/lib/klaviyo-api-sdk/models/timeframe.rb +++ b/lib/klaviyo-api-sdk/models/timeframe.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/tracking_param_dto.rb b/lib/klaviyo-api-sdk/models/tracking_param_dto.rb new file mode 100644 index 0000000..e882596 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_param_dto.rb @@ -0,0 +1,230 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TrackingParamDTO + attr_accessor :flow + + attr_accessor :campaign + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'flow' => :'flow', + :'campaign' => :'campaign' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'flow' => :'TrackingParamDTOFlow', + :'campaign' => :'TrackingParamDTOCampaign' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'flow', + :'campaign' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TrackingParamDTO` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TrackingParamDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'flow') + self.flow = attributes[:'flow'] + end + + if attributes.key?(:'campaign') + self.campaign = attributes[:'campaign'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + flow == o.flow && + campaign == o.campaign + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [flow, campaign].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/tracking_param_dto_campaign.rb b/lib/klaviyo-api-sdk/models/tracking_param_dto_campaign.rb new file mode 100644 index 0000000..2a7b734 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_param_dto_campaign.rb @@ -0,0 +1,106 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + # The value of the tracking parameter when applied to a campaign. + module TrackingParamDTOCampaign + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CampaignTrackingSettingDynamicParam', + :'CampaignTrackingSettingStaticParam' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = KlaviyoAPI.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/klaviyo-api-sdk/models/tracking_param_dto_flow.rb b/lib/klaviyo-api-sdk/models/tracking_param_dto_flow.rb new file mode 100644 index 0000000..0770807 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_param_dto_flow.rb @@ -0,0 +1,106 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + # The value of the tracking parameter when applied to a flow. + module TrackingParamDTOFlow + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'FlowTrackingSettingDynamicParam', + :'FlowTrackingSettingStaticParam' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = KlaviyoAPI.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/klaviyo-api-sdk/models/tracking_setting_enum.rb b/lib/klaviyo-api-sdk/models/tracking_setting_enum.rb new file mode 100644 index 0000000..d101b8f --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_setting_enum.rb @@ -0,0 +1,36 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TrackingSettingEnum + TRACKING_SETTING = "tracking-setting".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TrackingSettingEnum.constants.select { |c| TrackingSettingEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TrackingSettingEnum" if constantValues.empty? + value + end + end +end diff --git a/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query.rb b/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query.rb new file mode 100644 index 0000000..0c2e286 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TrackingSettingPartialUpdateQuery + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'TrackingSettingPartialUpdateQueryResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TrackingSettingPartialUpdateQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TrackingSettingPartialUpdateQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object.rb new file mode 100644 index 0000000..272a722 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object.rb @@ -0,0 +1,253 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TrackingSettingPartialUpdateQueryResourceObject + attr_accessor :type + + # The id of the tracking setting (account ID). + attr_accessor :id + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'id' => :'id', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'TrackingSettingEnum', + :'id' => :'String', + :'attributes' => :'TrackingSettingPartialUpdateQueryResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TrackingSettingPartialUpdateQueryResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TrackingSettingPartialUpdateQueryResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @id.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + id == o.id && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, id, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object_attributes.rb new file mode 100644 index 0000000..92b76e5 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/tracking_setting_partial_update_query_resource_object_attributes.rb @@ -0,0 +1,279 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class TrackingSettingPartialUpdateQueryResourceObjectAttributes + # Whether tracking parameters are automatically added to campaigns and flows. + attr_accessor :auto_add_parameters + + attr_accessor :utm_source + + attr_accessor :utm_medium + + attr_accessor :utm_campaign + + attr_accessor :utm_id + + attr_accessor :utm_term + + # List of custom tracking parameters. + attr_accessor :custom_parameters + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auto_add_parameters' => :'auto_add_parameters', + :'utm_source' => :'utm_source', + :'utm_medium' => :'utm_medium', + :'utm_campaign' => :'utm_campaign', + :'utm_id' => :'utm_id', + :'utm_term' => :'utm_term', + :'custom_parameters' => :'custom_parameters' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'auto_add_parameters' => :'Boolean', + :'utm_source' => :'TrackingParamDTO', + :'utm_medium' => :'TrackingParamDTO', + :'utm_campaign' => :'TrackingParamDTO', + :'utm_id' => :'TrackingParamDTO', + :'utm_term' => :'TrackingParamDTO', + :'custom_parameters' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'auto_add_parameters', + :'custom_parameters' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TrackingSettingPartialUpdateQueryResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TrackingSettingPartialUpdateQueryResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'auto_add_parameters') + self.auto_add_parameters = attributes[:'auto_add_parameters'] + end + + if attributes.key?(:'utm_source') + self.utm_source = attributes[:'utm_source'] + end + + if attributes.key?(:'utm_medium') + self.utm_medium = attributes[:'utm_medium'] + end + + if attributes.key?(:'utm_campaign') + self.utm_campaign = attributes[:'utm_campaign'] + end + + if attributes.key?(:'utm_id') + self.utm_id = attributes[:'utm_id'] + end + + if attributes.key?(:'utm_term') + self.utm_term = attributes[:'utm_term'] + end + + if attributes.key?(:'custom_parameters') + if (value = attributes[:'custom_parameters']).is_a?(Array) + self.custom_parameters = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auto_add_parameters == o.auto_add_parameters && + utm_source == o.utm_source && + utm_medium == o.utm_medium && + utm_campaign == o.utm_campaign && + utm_id == o.utm_id && + utm_term == o.utm_term && + custom_parameters == o.custom_parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [auto_add_parameters, utm_source, utm_medium, utm_campaign, utm_id, utm_term, custom_parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/union_positive_numeric_filter.rb b/lib/klaviyo-api-sdk/models/union_positive_numeric_filter.rb index e5c8191..6680584 100644 --- a/lib/klaviyo-api-sdk/models/union_positive_numeric_filter.rb +++ b/lib/klaviyo-api-sdk/models/union_positive_numeric_filter.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/union_positive_numeric_filter_operator.rb b/lib/klaviyo-api-sdk/models/union_positive_numeric_filter_operator.rb index cee7549..85268aa 100644 --- a/lib/klaviyo-api-sdk/models/union_positive_numeric_filter_operator.rb +++ b/lib/klaviyo-api-sdk/models/union_positive_numeric_filter_operator.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/universal_content_create_query.rb b/lib/klaviyo-api-sdk/models/universal_content_create_query.rb new file mode 100644 index 0000000..0d752d8 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_create_query.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class UniversalContentCreateQuery + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'UniversalContentCreateQueryResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UniversalContentCreateQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UniversalContentCreateQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object.rb new file mode 100644 index 0000000..dfb1630 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object.rb @@ -0,0 +1,238 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class UniversalContentCreateQueryResourceObject + attr_accessor :type + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'TemplateUniversalContentEnum', + :'attributes' => :'UniversalContentCreateQueryResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UniversalContentCreateQueryResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UniversalContentCreateQueryResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes.rb new file mode 100644 index 0000000..34e6980 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes.rb @@ -0,0 +1,239 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class UniversalContentCreateQueryResourceObjectAttributes + # The name for this universal content + attr_accessor :name + + attr_accessor :definition + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'definition' => :'definition' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'definition' => :'UniversalContentCreateQueryResourceObjectAttributesDefinition' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UniversalContentCreateQueryResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UniversalContentCreateQueryResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @definition.nil? + invalid_properties.push('invalid value for "definition", definition cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @definition.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + definition == o.definition + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, definition].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes_definition.rb b/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes_definition.rb new file mode 100644 index 0000000..6d30a1f --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_create_query_resource_object_attributes_definition.rb @@ -0,0 +1,105 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + module UniversalContentCreateQueryResourceObjectAttributesDefinition + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HTMLBlock', + :'TextBlock' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = KlaviyoAPI.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_partial_update_query.rb b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query.rb new file mode 100644 index 0000000..02f325c --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query.rb @@ -0,0 +1,224 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class UniversalContentPartialUpdateQuery + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'UniversalContentPartialUpdateQueryResourceObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UniversalContentPartialUpdateQuery` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UniversalContentPartialUpdateQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object.rb new file mode 100644 index 0000000..9fb508d --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object.rb @@ -0,0 +1,253 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class UniversalContentPartialUpdateQueryResourceObject + attr_accessor :type + + # The ID of the template universal content + attr_accessor :id + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'id' => :'id', + :'attributes' => :'attributes' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'TemplateUniversalContentEnum', + :'id' => :'String', + :'attributes' => :'UniversalContentPartialUpdateQueryResourceObjectAttributes' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UniversalContentPartialUpdateQueryResourceObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UniversalContentPartialUpdateQueryResourceObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @attributes.nil? + invalid_properties.push('invalid value for "attributes", attributes cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + return false if @id.nil? + return false if @attributes.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + id == o.id && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, id, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes.rb new file mode 100644 index 0000000..5efc489 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes.rb @@ -0,0 +1,231 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + class UniversalContentPartialUpdateQueryResourceObjectAttributes + # The name for this template universal content + attr_accessor :name + + attr_accessor :definition + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'definition' => :'definition' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'definition' => :'UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'name', + :'definition' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::UniversalContentPartialUpdateQueryResourceObjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::UniversalContentPartialUpdateQueryResourceObjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + definition == o.definition + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, definition].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = KlaviyoAPI.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes_definition.rb b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes_definition.rb new file mode 100644 index 0000000..b708475 --- /dev/null +++ b/lib/klaviyo-api-sdk/models/universal_content_partial_update_query_resource_object_attributes_definition.rb @@ -0,0 +1,105 @@ +=begin +#Klaviyo API + +#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. + +The version of the OpenAPI document: 2024-10-15 +Contact: developers@klaviyo.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.2.1 + +=end + +require 'date' +require 'time' + +module KlaviyoAPI + module UniversalContentPartialUpdateQueryResourceObjectAttributesDefinition + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HTMLBlock', + :'TextBlock' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = KlaviyoAPI.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/klaviyo-api-sdk/models/unsubscribed_enum.rb b/lib/klaviyo-api-sdk/models/unsubscribed_enum.rb index 02ec6b4..6c38fb9 100644 --- a/lib/klaviyo-api-sdk/models/unsubscribed_enum.rb +++ b/lib/klaviyo-api-sdk/models/unsubscribed_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_create_query.rb b/lib/klaviyo-api-sdk/models/webhook_create_query.rb index ca05ebb..87fa16d 100644 --- a/lib/klaviyo-api-sdk/models/webhook_create_query.rb +++ b/lib/klaviyo-api-sdk/models/webhook_create_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object.rb b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object.rb index a4384a9..07a2bac 100644 --- a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_attributes.rb index fd1cae9..ec1ae1c 100644 --- a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships.rb b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships.rb index 1978e03..d3f0bb2 100644 --- a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships.rb +++ b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics.rb b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics.rb index ced5563..e52f08d 100644 --- a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics.rb +++ b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics_data_inner.rb b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics_data_inner.rb index 915e86e..99351dd 100644 --- a/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics_data_inner.rb +++ b/lib/klaviyo-api-sdk/models/webhook_create_query_resource_object_relationships_webhook_topics_data_inner.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_enum.rb b/lib/klaviyo-api-sdk/models/webhook_enum.rb index c14fef4..54afe03 100644 --- a/lib/klaviyo-api-sdk/models/webhook_enum.rb +++ b/lib/klaviyo-api-sdk/models/webhook_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_partial_update_query.rb b/lib/klaviyo-api-sdk/models/webhook_partial_update_query.rb index c4d7045..12ea503 100644 --- a/lib/klaviyo-api-sdk/models/webhook_partial_update_query.rb +++ b/lib/klaviyo-api-sdk/models/webhook_partial_update_query.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object.rb b/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object.rb index cb57727..6f9be34 100644 --- a/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object.rb +++ b/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object_attributes.rb b/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object_attributes.rb index aba0b76..59b63f5 100644 --- a/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object_attributes.rb +++ b/lib/klaviyo-api-sdk/models/webhook_partial_update_query_resource_object_attributes.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/models/webhook_topic_enum.rb b/lib/klaviyo-api-sdk/models/webhook_topic_enum.rb index 1bd80da..fe88e11 100644 --- a/lib/klaviyo-api-sdk/models/webhook_topic_enum.rb +++ b/lib/klaviyo-api-sdk/models/webhook_topic_enum.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1 diff --git a/lib/klaviyo-api-sdk/version.rb b/lib/klaviyo-api-sdk/version.rb index 3d04f1c..4f7f4a1 100644 --- a/lib/klaviyo-api-sdk/version.rb +++ b/lib/klaviyo-api-sdk/version.rb @@ -3,7 +3,7 @@ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. -The version of the OpenAPI document: 2024-07-15 +The version of the OpenAPI document: 2024-10-15 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.2.1