klaviyo-api-sdk 17.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +932 -414
- data/klaviyo-api-sdk.gemspec +1 -1
- data/lib/klaviyo-api-sdk/api/accounts_api.rb +12 -12
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +215 -155
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +585 -381
- data/lib/klaviyo-api-sdk/api/client_api.rb +100 -0
- data/lib/klaviyo-api-sdk/api/conversations_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/coupons_api.rb +187 -108
- data/lib/klaviyo-api-sdk/api/custom_objects_api.rb +2755 -83
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/events_api.rb +72 -58
- data/lib/klaviyo-api-sdk/api/flows_api.rb +238 -152
- data/lib/klaviyo-api-sdk/api/forms_api.rb +81 -60
- data/lib/klaviyo-api-sdk/api/images_api.rb +48 -27
- data/lib/klaviyo-api-sdk/api/lists_api.rb +113 -88
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +184 -156
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +445 -226
- data/lib/klaviyo-api-sdk/api/reporting_api.rb +76 -27
- data/lib/klaviyo-api-sdk/api/reviews_api.rb +38 -31
- data/lib/klaviyo-api-sdk/api/segments_api.rb +107 -82
- data/lib/klaviyo-api-sdk/api/tags_api.rb +164 -128
- data/lib/klaviyo-api-sdk/api/templates_api.rb +113 -60
- data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +24 -17
- data/lib/klaviyo-api-sdk/api/web_feeds_api.rb +41 -27
- data/lib/klaviyo-api-sdk/api/webhooks_api.rb +73 -31
- data/lib/klaviyo-api-sdk/api_client.rb +1 -1
- data/lib/klaviyo-api-sdk/models/action_output_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/action_output_condition_filter.rb +78 -195
- data/lib/klaviyo-api-sdk/models/action_output_split_action_data.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters.rb → action_output_split_action_data_action_output_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{action_output_condition_condition_group.rb → action_output_split_action_data_action_output_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/age_gate_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/api_schema_property.rb +301 -0
- data/lib/klaviyo-api-sdk/models/back_in_stock_email_consent_checkbox_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/base_event_create_query_bulk_entry_resource_object_attributes.rb +15 -2
- data/lib/klaviyo-api-sdk/models/base_style_properties.rb +15 -5
- data/lib/klaviyo-api-sdk/models/button_action.rb +1 -0
- data/lib/klaviyo-api-sdk/models/button_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/button_styles.rb +25 -3
- data/lib/klaviyo-api-sdk/models/{action_output_condition_filter2.rb → button_styles_height.rb} +3 -7
- data/lib/klaviyo-api-sdk/models/cart_content.rb +277 -0
- data/lib/klaviyo-api-sdk/models/cart_content_properties.rb +236 -0
- data/lib/klaviyo-api-sdk/models/checkboxes_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/conditional_branch_action_data_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/constant_property_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/{price_drop_condition_filter2.rb → constant_property_mapping_value.rb} +6 -16
- data/lib/klaviyo-api-sdk/models/content_experiment_action.rb +1 -1
- data/lib/klaviyo-api-sdk/models/{send_push_notification_action_content_experiment_action_data.rb → content_experiment_action_data.rb} +6 -5
- data/lib/klaviyo-api-sdk/models/{send_push_notification_action_current_experiment.rb → content_experiment_action_data_current_experiment.rb} +6 -6
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter2.rb → content_experiment_action_data_main_action.rb} +3 -16
- data/lib/klaviyo-api-sdk/models/countdown_timer_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/coupon_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/custom_css.rb +231 -0
- data/lib/klaviyo-api-sdk/models/custom_html.rb +292 -0
- data/lib/klaviyo-api-sdk/models/custom_html_properties.rb +263 -0
- data/lib/klaviyo-api-sdk/models/custom_object_date_trigger.rb +450 -0
- data/lib/klaviyo-api-sdk/models/custom_object_property_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/custom_object_relationship_source.rb +328 -0
- data/lib/klaviyo-api-sdk/models/date_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/display_options.rb +24 -4
- data/lib/klaviyo-api-sdk/models/dropdown_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/email_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb +13 -9
- data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +13 -9
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes.rb +292 -0
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes_source_mapping.rb +224 -0
- data/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +15 -2
- data/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb +14 -1
- data/lib/klaviyo-api-sdk/models/flow_definition_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/flow_definition_triggers_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/flow_email.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_push_notification.rb +14 -4
- data/lib/klaviyo-api-sdk/models/flow_sms.rb +15 -2
- data/lib/klaviyo-api-sdk/models/form_create_query_resource_object_attributes.rb +2 -2
- data/lib/klaviyo-api-sdk/models/html_text_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen.rb +305 -0
- data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen_properties.rb +220 -0
- data/lib/klaviyo-api-sdk/models/image_action.rb +1 -0
- data/lib/klaviyo-api-sdk/models/image_block_cropping_properties.rb +0 -35
- data/lib/klaviyo-api-sdk/models/image_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/low_inventory_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/low_inventory_trigger.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter.rb → low_inventory_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_condition_group.rb → low_inventory_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb +2 -2
- data/lib/klaviyo-api-sdk/models/metric_property_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/metric_property_condition_filter.rb +87 -195
- data/lib/klaviyo-api-sdk/models/metric_trigger.rb +2 -1
- data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters.rb → metric_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters_condition_groups_inner.rb → metric_trigger_trigger_filter_condition_groups_inner.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/mobile_push_content_create.rb +18 -5
- data/lib/klaviyo-api-sdk/models/mobile_push_content_update.rb +18 -5
- data/lib/klaviyo-api-sdk/models/mobile_push_options_on_open.rb +2 -1
- data/lib/klaviyo-api-sdk/models/multi_branch_split_branch_branch_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/object_record_bulk_delete_job_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters_condition_groups_inner.rb → object_record_delete_job_create_query_resource_object_relationships.rb} +13 -15
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object_relationships_object_records.rb +220 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_rels_records_data_inner.rb +238 -0
- data/lib/klaviyo-api-sdk/models/object_record_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object.rb +246 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_attributes.rb +322 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships.rb +218 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type.rb +218 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type_data.rb +238 -0
- data/lib/klaviyo-api-sdk/models/object_schema_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object.rb +252 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object_attributes.rb +302 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_create_meta.rb +237 -0
- data/lib/klaviyo-api-sdk/models/{metric_property_condition_condition_group.rb → object_schema_relationship_create_query.rb} +14 -14
- data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters_condition_groups_inner.rb → object_schema_relationship_create_query_data_inner.rb} +37 -15
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_meta.rb +224 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query_data.rb +247 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_update_meta.rb +246 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes.rb +307 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes_object_schema.rb +224 -0
- data/lib/klaviyo-api-sdk/models/object_type_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +13 -4
- data/lib/klaviyo-api-sdk/models/open_tracking_subscription_parameters.rb +258 -0
- data/lib/klaviyo-api-sdk/models/open_tracking_unsubscription_parameters.rb +258 -0
- data/lib/klaviyo-api-sdk/models/opt_in_code_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/patch_identifiers.rb +227 -0
- data/lib/klaviyo-api-sdk/models/phone_number_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/price_drop_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/price_drop_trigger.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters.rb → price_drop_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{price_drop_condition_condition_group.rb → price_drop_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/profile_event_tracked_properties.rb +19 -9
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_email_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/{profile_has_not_received_push_message_condition_timeframe_filter.rb → profile_has_not_received_email_message_condition_timeframe_filter.rb} +1 -1
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_push_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_sms_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_meta.rb +13 -4
- data/lib/klaviyo-api-sdk/models/profile_not_in_flow_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_object_schema_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query_data.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb +2 -2
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_condition.rb +2 -2
- data/lib/klaviyo-api-sdk/models/profile_relationship_source.rb +330 -0
- data/lib/klaviyo-api-sdk/models/property_filter.rb +237 -0
- data/lib/klaviyo-api-sdk/models/property_source.rb +254 -0
- data/lib/klaviyo-api-sdk/models/push_action_button.rb +1 -5
- data/lib/klaviyo-api-sdk/models/push_action_button_definition.rb +261 -0
- data/lib/klaviyo-api-sdk/models/push_on_open_web_url.rb +268 -0
- data/lib/klaviyo-api-sdk/models/quote_style.rb +21 -1
- data/lib/klaviyo-api-sdk/models/radio_buttons_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/redirect_properties.rb +2 -5
- data/lib/klaviyo-api-sdk/models/related_id_path.rb +273 -0
- data/lib/klaviyo-api-sdk/models/review_block_styles.rb +13 -13
- data/lib/klaviyo-api-sdk/models/review_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/reviewer_name_style.rb +21 -1
- data/lib/klaviyo-api-sdk/models/row_v0_blocks_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/signup_counter_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/simple_property_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/simple_relationship_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/simple_relationship_mapping_source.rb +105 -0
- data/lib/klaviyo-api-sdk/models/sms_consent_checkbox_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/sms_disclosure_link_text_style.rb +319 -0
- data/lib/klaviyo-api-sdk/models/sms_disclosure_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/sms_disclosure_styles.rb +1 -1
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes.rb +235 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes_property_mappings_inner.rb +104 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query_resource_object.rb +252 -0
- data/lib/klaviyo-api-sdk/models/spin_to_win_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/string_phone_operator_string_array_filter.rb +1 -1
- data/lib/klaviyo-api-sdk/models/table_fallback_image_sub_block.rb +0 -13
- data/lib/klaviyo-api-sdk/models/table_image_sub_block.rb +0 -13
- data/lib/klaviyo-api-sdk/models/template_definition.rb +1 -0
- data/lib/klaviyo-api-sdk/models/text_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/version.rb +39 -4
- data/lib/klaviyo-api-sdk/models/version_properties.rb +14 -4
- data/lib/klaviyo-api-sdk/models/version_styles.rb +15 -6
- data/lib/klaviyo-api-sdk/models/version_triggers_inner.rb +1 -0
- data/lib/klaviyo-api-sdk.rb +86 -23
- data/lib/klaviyo-api-sdk.rb.bak +87 -24
- metadata +88 -25
- data/lib/klaviyo-api-sdk/models/custom_object_property_condition_filter.rb +0 -117
- data/lib/klaviyo-api-sdk/models/flow_email_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/flow_push_notification_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/flow_sms_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/metric_property_condition_filter2.rb +0 -117
- data/lib/klaviyo-api-sdk/models/price_drop_condition_filter.rb +0 -225
|
@@ -19,7 +19,7 @@ module KlaviyoAPI
|
|
|
19
19
|
@api_client = api_client
|
|
20
20
|
end
|
|
21
21
|
# Bulk Create Data Source Records
|
|
22
|
-
# Create a bulk data source record import job to create a batch of records. Accepts up to 500 records per request. The maximum allowed payload size is 4MB. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `15/m` **Scopes:** `custom-objects:write`
|
|
22
|
+
# Create a bulk data source record import job to create a batch of records. Accepts up to 500 records per request. The maximum allowed payload size is 4MB. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `15/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/bulk_create_data_source_records.json)
|
|
23
23
|
# @param data_source_record_bulk_create_job_create_query [DataSourceRecordBulkCreateJobCreateQuery] Create a data source record job
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
25
|
# @return [nil]
|
|
@@ -32,7 +32,7 @@ module KlaviyoAPI
|
|
|
32
32
|
alias create_data_source_record_bulk_create_job bulk_create_data_source_records
|
|
33
33
|
|
|
34
34
|
# Bulk Create Data Source Records
|
|
35
|
-
# Create a bulk data source record import job to create a batch of records. Accepts up to 500 records per request. The maximum allowed payload size is 4MB. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `15/m` **Scopes:** `custom-objects:write`
|
|
35
|
+
# Create a bulk data source record import job to create a batch of records. Accepts up to 500 records per request. The maximum allowed payload size is 4MB. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `15/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/bulk_create_data_source_records.json)
|
|
36
36
|
# @param data_source_record_bulk_create_job_create_query [DataSourceRecordBulkCreateJobCreateQuery] Create a data source record job
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
38
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -53,7 +53,7 @@ module KlaviyoAPI
|
|
|
53
53
|
# header parameters
|
|
54
54
|
header_params = opts[:header_params] || {}
|
|
55
55
|
# klaviyo api revision
|
|
56
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
56
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
57
57
|
# HTTP header 'Accept' (if needed)
|
|
58
58
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
59
59
|
# HTTP header 'Content-Type'
|
|
@@ -94,10 +94,87 @@ module KlaviyoAPI
|
|
|
94
94
|
# alias of `bulk_create_data_source_records_with_http_info`
|
|
95
95
|
alias create_data_source_record_bulk_create_job_with_http_info bulk_create_data_source_records_with_http_info
|
|
96
96
|
|
|
97
|
+
# Bulk Delete Object Records
|
|
98
|
+
# Delete a batch of object records. Accepts up to 500 object record IDs per request. The maximum allowed payload size is 5MB.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/bulk_delete_object_records.json)
|
|
99
|
+
# @param object_record_delete_job_create_query [ObjectRecordDeleteJobCreateQuery]
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @return [nil]
|
|
102
|
+
def bulk_delete_object_records(object_record_delete_job_create_query, opts = {})
|
|
103
|
+
bulk_delete_object_records_with_http_info(object_record_delete_job_create_query, opts)
|
|
104
|
+
nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# alias of `bulk_delete_object_records`
|
|
108
|
+
alias create_object_record_bulk_delete_job bulk_delete_object_records
|
|
109
|
+
|
|
110
|
+
# Bulk Delete Object Records
|
|
111
|
+
# Delete a batch of object records. Accepts up to 500 object record IDs per request. The maximum allowed payload size is 5MB.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/bulk_delete_object_records.json)
|
|
112
|
+
# @param object_record_delete_job_create_query [ObjectRecordDeleteJobCreateQuery]
|
|
113
|
+
# @param [Hash] opts the optional parameters
|
|
114
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
115
|
+
def bulk_delete_object_records_with_http_info(object_record_delete_job_create_query, opts = {})
|
|
116
|
+
if @api_client.config.debugging
|
|
117
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.bulk_delete_object_records ...'
|
|
118
|
+
end
|
|
119
|
+
# verify the required parameter 'object_record_delete_job_create_query' is set
|
|
120
|
+
if @api_client.config.client_side_validation && object_record_delete_job_create_query.nil?
|
|
121
|
+
fail ArgumentError, "Missing the required parameter 'object_record_delete_job_create_query' when calling CustomObjectsApi.bulk_delete_object_records"
|
|
122
|
+
end
|
|
123
|
+
# resource path
|
|
124
|
+
local_var_path = '/api/object-record-bulk-delete-jobs'
|
|
125
|
+
|
|
126
|
+
# query parameters
|
|
127
|
+
query_params = opts[:query_params] || {}
|
|
128
|
+
|
|
129
|
+
# header parameters
|
|
130
|
+
header_params = opts[:header_params] || {}
|
|
131
|
+
# klaviyo api revision
|
|
132
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
133
|
+
# HTTP header 'Accept' (if needed)
|
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
135
|
+
# HTTP header 'Content-Type'
|
|
136
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
137
|
+
if !content_type.nil?
|
|
138
|
+
header_params['Content-Type'] = content_type
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_record_delete_job_create_query)
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type]
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"CustomObjectsApi.bulk_delete_object_records",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#bulk_delete_object_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# alias of `bulk_delete_object_records_with_http_info`
|
|
171
|
+
alias create_object_record_bulk_delete_job_with_http_info bulk_delete_object_records_with_http_info
|
|
172
|
+
|
|
97
173
|
# Create Data Source
|
|
98
|
-
# Create a new data source in an account<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write`
|
|
174
|
+
# Create a new data source in an account<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_data_source.json)
|
|
99
175
|
# @param data_source_create_query [DataSourceCreateQuery] Create data source
|
|
100
176
|
# @param [Hash] opts the optional parameters
|
|
177
|
+
# @option opts [Array<String>] :fields_data_source For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
101
178
|
# @return [Hash<String, Object>]
|
|
102
179
|
def create_data_source(data_source_create_query, opts = {})
|
|
103
180
|
data, _status_code, _headers = create_data_source_with_http_info(data_source_create_query, opts)
|
|
@@ -105,9 +182,10 @@ module KlaviyoAPI
|
|
|
105
182
|
end
|
|
106
183
|
|
|
107
184
|
# Create Data Source
|
|
108
|
-
# Create a new data source in an account<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write`
|
|
185
|
+
# Create a new data source in an account<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_data_source.json)
|
|
109
186
|
# @param data_source_create_query [DataSourceCreateQuery] Create data source
|
|
110
187
|
# @param [Hash] opts the optional parameters
|
|
188
|
+
# @option opts [Array<String>] :fields_data_source For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
111
189
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
112
190
|
def create_data_source_with_http_info(data_source_create_query, opts = {})
|
|
113
191
|
if @api_client.config.debugging
|
|
@@ -117,16 +195,21 @@ module KlaviyoAPI
|
|
|
117
195
|
if @api_client.config.client_side_validation && data_source_create_query.nil?
|
|
118
196
|
fail ArgumentError, "Missing the required parameter 'data_source_create_query' when calling CustomObjectsApi.create_data_source"
|
|
119
197
|
end
|
|
198
|
+
allowable_values = ["description", "id", "namespace", "title", "visibility"]
|
|
199
|
+
if @api_client.config.client_side_validation && opts[:'fields_data_source'] && !opts[:'fields_data_source'].all? { |item| allowable_values.include?(item) }
|
|
200
|
+
fail ArgumentError, "invalid value for \"fields_data_source\", must include one of #{allowable_values}"
|
|
201
|
+
end
|
|
120
202
|
# resource path
|
|
121
203
|
local_var_path = '/api/data-sources'
|
|
122
204
|
|
|
123
205
|
# query parameters
|
|
124
206
|
query_params = opts[:query_params] || {}
|
|
207
|
+
query_params[:'fields[data-source]'] = @api_client.build_collection_param(opts[:'fields_data_source'], :csv) if !opts[:'fields_data_source'].nil?
|
|
125
208
|
|
|
126
209
|
# header parameters
|
|
127
210
|
header_params = opts[:header_params] || {}
|
|
128
211
|
# klaviyo api revision
|
|
129
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
212
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
130
213
|
# HTTP header 'Accept' (if needed)
|
|
131
214
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
132
215
|
# HTTP header 'Content-Type'
|
|
@@ -165,7 +248,7 @@ module KlaviyoAPI
|
|
|
165
248
|
end
|
|
166
249
|
|
|
167
250
|
# Create Data Source Record
|
|
168
|
-
# Create a data source record import job to create a single record. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `custom-objects:write`
|
|
251
|
+
# Create a data source record import job to create a single record. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_data_source_record.json)
|
|
169
252
|
# @param data_source_record_create_job_create_query [DataSourceRecordCreateJobCreateQuery] Create a data source record job
|
|
170
253
|
# @param [Hash] opts the optional parameters
|
|
171
254
|
# @return [nil]
|
|
@@ -178,7 +261,7 @@ module KlaviyoAPI
|
|
|
178
261
|
alias create_data_source_record_create_job create_data_source_record
|
|
179
262
|
|
|
180
263
|
# Create Data Source Record
|
|
181
|
-
# Create a data source record import job to create a single record. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `custom-objects:write`
|
|
264
|
+
# Create a data source record import job to create a single record. The maximum allowed payload size per-record is 512KB. To learn more, see our [Custom Objects API overview](https://developers.klaviyo.com/en/reference/custom_objects_api_overview).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_data_source_record.json)
|
|
182
265
|
# @param data_source_record_create_job_create_query [DataSourceRecordCreateJobCreateQuery] Create a data source record job
|
|
183
266
|
# @param [Hash] opts the optional parameters
|
|
184
267
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -199,7 +282,7 @@ module KlaviyoAPI
|
|
|
199
282
|
# header parameters
|
|
200
283
|
header_params = opts[:header_params] || {}
|
|
201
284
|
# klaviyo api revision
|
|
202
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
285
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
203
286
|
# HTTP header 'Accept' (if needed)
|
|
204
287
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
205
288
|
# HTTP header 'Content-Type'
|
|
@@ -240,31 +323,120 @@ module KlaviyoAPI
|
|
|
240
323
|
# alias of `create_data_source_record_with_http_info`
|
|
241
324
|
alias create_data_source_record_create_job_with_http_info create_data_source_record_with_http_info
|
|
242
325
|
|
|
243
|
-
#
|
|
244
|
-
#
|
|
245
|
-
# @param
|
|
326
|
+
# Create Object Schema
|
|
327
|
+
# Create an object schema.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_schema.json)
|
|
328
|
+
# @param object_schema_create_query [ObjectSchemaCreateQuery] Create an object schema
|
|
329
|
+
# @param [Hash] opts the optional parameters
|
|
330
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
331
|
+
# @return [Hash<String, Object>]
|
|
332
|
+
def create_object_schema(object_schema_create_query, opts = {})
|
|
333
|
+
data, _status_code, _headers = create_object_schema_with_http_info(object_schema_create_query, opts)
|
|
334
|
+
data
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Create Object Schema
|
|
338
|
+
# Create an object schema.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_schema.json)
|
|
339
|
+
# @param object_schema_create_query [ObjectSchemaCreateQuery] Create an object schema
|
|
340
|
+
# @param [Hash] opts the optional parameters
|
|
341
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
342
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
343
|
+
def create_object_schema_with_http_info(object_schema_create_query, opts = {})
|
|
344
|
+
if @api_client.config.debugging
|
|
345
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.create_object_schema ...'
|
|
346
|
+
end
|
|
347
|
+
# verify the required parameter 'object_schema_create_query' is set
|
|
348
|
+
if @api_client.config.client_side_validation && object_schema_create_query.nil?
|
|
349
|
+
fail ArgumentError, "Missing the required parameter 'object_schema_create_query' when calling CustomObjectsApi.create_object_schema"
|
|
350
|
+
end
|
|
351
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
352
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
353
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
354
|
+
end
|
|
355
|
+
# resource path
|
|
356
|
+
local_var_path = '/api/object-schemas'
|
|
357
|
+
|
|
358
|
+
# query parameters
|
|
359
|
+
query_params = opts[:query_params] || {}
|
|
360
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
361
|
+
|
|
362
|
+
# header parameters
|
|
363
|
+
header_params = opts[:header_params] || {}
|
|
364
|
+
# klaviyo api revision
|
|
365
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
366
|
+
# HTTP header 'Accept' (if needed)
|
|
367
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
368
|
+
# HTTP header 'Content-Type'
|
|
369
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
370
|
+
if !content_type.nil?
|
|
371
|
+
header_params['Content-Type'] = content_type
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# form parameters
|
|
375
|
+
form_params = opts[:form_params] || {}
|
|
376
|
+
|
|
377
|
+
# http body (model)
|
|
378
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_schema_create_query)
|
|
379
|
+
|
|
380
|
+
# return_type
|
|
381
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
382
|
+
|
|
383
|
+
# auth_names
|
|
384
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
385
|
+
|
|
386
|
+
new_options = opts.merge(
|
|
387
|
+
:operation => :"CustomObjectsApi.create_object_schema",
|
|
388
|
+
:header_params => header_params,
|
|
389
|
+
:query_params => query_params,
|
|
390
|
+
:form_params => form_params,
|
|
391
|
+
:body => post_body,
|
|
392
|
+
:auth_names => auth_names,
|
|
393
|
+
:return_type => return_type
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
397
|
+
if @api_client.config.debugging
|
|
398
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#create_object_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
399
|
+
end
|
|
400
|
+
return data, status_code, headers
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Create Object Schema Relationship
|
|
404
|
+
# Create a relationship between object schemas. Note that flow filtering and segmentation are currently not supported for object-to-object relationships.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_schema_relationship.json)
|
|
405
|
+
# @param id [String] The ULID ID of the object schema.
|
|
406
|
+
# @param object_schema_relationship_create_query [ObjectSchemaRelationshipCreateQuery] Create a relationship between object schemas
|
|
246
407
|
# @param [Hash] opts the optional parameters
|
|
247
408
|
# @return [nil]
|
|
248
|
-
def
|
|
249
|
-
|
|
409
|
+
def create_object_schema_relationship(id, object_schema_relationship_create_query, opts = {})
|
|
410
|
+
create_object_schema_relationship_with_http_info(id, object_schema_relationship_create_query, opts)
|
|
250
411
|
nil
|
|
251
412
|
end
|
|
252
413
|
|
|
253
|
-
#
|
|
254
|
-
|
|
255
|
-
|
|
414
|
+
# alias of `create_object_schema_relationship`
|
|
415
|
+
alias add_schemas_to_object_schema create_object_schema_relationship
|
|
416
|
+
|
|
417
|
+
# alias of `create_object_schema_relationship`
|
|
418
|
+
alias create_object_schema_relationships_schemas create_object_schema_relationship
|
|
419
|
+
|
|
420
|
+
# Create Object Schema Relationship
|
|
421
|
+
# Create a relationship between object schemas. Note that flow filtering and segmentation are currently not supported for object-to-object relationships.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_schema_relationship.json)
|
|
422
|
+
# @param id [String] The ULID ID of the object schema.
|
|
423
|
+
# @param object_schema_relationship_create_query [ObjectSchemaRelationshipCreateQuery] Create a relationship between object schemas
|
|
256
424
|
# @param [Hash] opts the optional parameters
|
|
257
425
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
258
|
-
def
|
|
426
|
+
def create_object_schema_relationship_with_http_info(id, object_schema_relationship_create_query, opts = {})
|
|
259
427
|
if @api_client.config.debugging
|
|
260
|
-
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.
|
|
428
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.create_object_schema_relationship ...'
|
|
261
429
|
end
|
|
262
430
|
# verify the required parameter 'id' is set
|
|
263
431
|
if @api_client.config.client_side_validation && id.nil?
|
|
264
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.
|
|
432
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.create_object_schema_relationship"
|
|
433
|
+
end
|
|
434
|
+
# verify the required parameter 'object_schema_relationship_create_query' is set
|
|
435
|
+
if @api_client.config.client_side_validation && object_schema_relationship_create_query.nil?
|
|
436
|
+
fail ArgumentError, "Missing the required parameter 'object_schema_relationship_create_query' when calling CustomObjectsApi.create_object_schema_relationship"
|
|
265
437
|
end
|
|
266
438
|
# resource path
|
|
267
|
-
local_var_path = '/api/
|
|
439
|
+
local_var_path = '/api/object-schemas/{id}/relationships/object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
268
440
|
|
|
269
441
|
# query parameters
|
|
270
442
|
query_params = opts[:query_params] || {}
|
|
@@ -272,15 +444,20 @@ module KlaviyoAPI
|
|
|
272
444
|
# header parameters
|
|
273
445
|
header_params = opts[:header_params] || {}
|
|
274
446
|
# klaviyo api revision
|
|
275
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
447
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
276
448
|
# HTTP header 'Accept' (if needed)
|
|
277
449
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
450
|
+
# HTTP header 'Content-Type'
|
|
451
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
452
|
+
if !content_type.nil?
|
|
453
|
+
header_params['Content-Type'] = content_type
|
|
454
|
+
end
|
|
278
455
|
|
|
279
456
|
# form parameters
|
|
280
457
|
form_params = opts[:form_params] || {}
|
|
281
458
|
|
|
282
459
|
# http body (model)
|
|
283
|
-
post_body = opts[:debug_body]
|
|
460
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_schema_relationship_create_query)
|
|
284
461
|
|
|
285
462
|
# return_type
|
|
286
463
|
return_type = opts[:debug_return_type]
|
|
@@ -289,7 +466,7 @@ module KlaviyoAPI
|
|
|
289
466
|
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
290
467
|
|
|
291
468
|
new_options = opts.merge(
|
|
292
|
-
:operation => :"CustomObjectsApi.
|
|
469
|
+
:operation => :"CustomObjectsApi.create_object_schema_relationship",
|
|
293
470
|
:header_params => header_params,
|
|
294
471
|
:query_params => query_params,
|
|
295
472
|
:form_params => form_params,
|
|
@@ -298,61 +475,72 @@ module KlaviyoAPI
|
|
|
298
475
|
:return_type => return_type
|
|
299
476
|
)
|
|
300
477
|
|
|
301
|
-
data, status_code, headers = @api_client.call_api(:
|
|
478
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
302
479
|
if @api_client.config.debugging
|
|
303
|
-
@api_client.config.logger.debug "API called: CustomObjectsApi#
|
|
480
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#create_object_schema_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
304
481
|
end
|
|
305
482
|
return data, status_code, headers
|
|
306
483
|
end
|
|
307
484
|
|
|
308
|
-
#
|
|
309
|
-
|
|
310
|
-
|
|
485
|
+
# alias of `create_object_schema_relationship_with_http_info`
|
|
486
|
+
alias add_schemas_to_object_schema_with_http_info create_object_schema_relationship_with_http_info
|
|
487
|
+
|
|
488
|
+
# alias of `create_object_schema_relationship_with_http_info`
|
|
489
|
+
alias create_object_schema_relationships_schemas_with_http_info create_object_schema_relationship_with_http_info
|
|
490
|
+
|
|
491
|
+
# Create Object Type
|
|
492
|
+
# Create an object type.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_type.json)
|
|
493
|
+
# @param object_type_create_query [ObjectTypeCreateQuery] Create an object type
|
|
311
494
|
# @param [Hash] opts the optional parameters
|
|
312
|
-
# @option opts [Array<String>] :
|
|
495
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
313
496
|
# @return [Hash<String, Object>]
|
|
314
|
-
def
|
|
315
|
-
data, _status_code, _headers =
|
|
497
|
+
def create_object_type(object_type_create_query, opts = {})
|
|
498
|
+
data, _status_code, _headers = create_object_type_with_http_info(object_type_create_query, opts)
|
|
316
499
|
data
|
|
317
500
|
end
|
|
318
501
|
|
|
319
|
-
#
|
|
320
|
-
#
|
|
321
|
-
# @param
|
|
502
|
+
# Create Object Type
|
|
503
|
+
# Create an object type.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_object_type.json)
|
|
504
|
+
# @param object_type_create_query [ObjectTypeCreateQuery] Create an object type
|
|
322
505
|
# @param [Hash] opts the optional parameters
|
|
323
|
-
# @option opts [Array<String>] :
|
|
506
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
324
507
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
325
|
-
def
|
|
508
|
+
def create_object_type_with_http_info(object_type_create_query, opts = {})
|
|
326
509
|
if @api_client.config.debugging
|
|
327
|
-
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.
|
|
510
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.create_object_type ...'
|
|
328
511
|
end
|
|
329
|
-
# verify the required parameter '
|
|
330
|
-
if @api_client.config.client_side_validation &&
|
|
331
|
-
fail ArgumentError, "Missing the required parameter '
|
|
512
|
+
# verify the required parameter 'object_type_create_query' is set
|
|
513
|
+
if @api_client.config.client_side_validation && object_type_create_query.nil?
|
|
514
|
+
fail ArgumentError, "Missing the required parameter 'object_type_create_query' when calling CustomObjectsApi.create_object_type"
|
|
332
515
|
end
|
|
333
|
-
allowable_values = ["description", "namespace", "title", "
|
|
334
|
-
if @api_client.config.client_side_validation && opts[:'
|
|
335
|
-
fail ArgumentError, "invalid value for \"
|
|
516
|
+
allowable_values = ["created_at", "description", "id", "namespace", "status", "title", "updated_at"]
|
|
517
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_type'] && !opts[:'fields_object_type'].all? { |item| allowable_values.include?(item) }
|
|
518
|
+
fail ArgumentError, "invalid value for \"fields_object_type\", must include one of #{allowable_values}"
|
|
336
519
|
end
|
|
337
520
|
# resource path
|
|
338
|
-
local_var_path = '/api/
|
|
521
|
+
local_var_path = '/api/object-types'
|
|
339
522
|
|
|
340
523
|
# query parameters
|
|
341
524
|
query_params = opts[:query_params] || {}
|
|
342
|
-
query_params[:'fields[
|
|
525
|
+
query_params[:'fields[object-type]'] = @api_client.build_collection_param(opts[:'fields_object_type'], :csv) if !opts[:'fields_object_type'].nil?
|
|
343
526
|
|
|
344
527
|
# header parameters
|
|
345
528
|
header_params = opts[:header_params] || {}
|
|
346
529
|
# klaviyo api revision
|
|
347
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
530
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
348
531
|
# HTTP header 'Accept' (if needed)
|
|
349
532
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
533
|
+
# HTTP header 'Content-Type'
|
|
534
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
535
|
+
if !content_type.nil?
|
|
536
|
+
header_params['Content-Type'] = content_type
|
|
537
|
+
end
|
|
350
538
|
|
|
351
539
|
# form parameters
|
|
352
540
|
form_params = opts[:form_params] || {}
|
|
353
541
|
|
|
354
542
|
# http body (model)
|
|
355
|
-
post_body = opts[:debug_body]
|
|
543
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_type_create_query)
|
|
356
544
|
|
|
357
545
|
# return_type
|
|
358
546
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
@@ -361,7 +549,7 @@ module KlaviyoAPI
|
|
|
361
549
|
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
362
550
|
|
|
363
551
|
new_options = opts.merge(
|
|
364
|
-
:operation => :"CustomObjectsApi.
|
|
552
|
+
:operation => :"CustomObjectsApi.create_object_type",
|
|
365
553
|
:header_params => header_params,
|
|
366
554
|
:query_params => query_params,
|
|
367
555
|
:form_params => form_params,
|
|
@@ -370,61 +558,134 @@ module KlaviyoAPI
|
|
|
370
558
|
:return_type => return_type
|
|
371
559
|
)
|
|
372
560
|
|
|
373
|
-
data, status_code, headers = @api_client.call_api(:
|
|
561
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
374
562
|
if @api_client.config.debugging
|
|
375
|
-
@api_client.config.logger.debug "API called: CustomObjectsApi#
|
|
563
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#create_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
376
564
|
end
|
|
377
565
|
return data, status_code, headers
|
|
378
566
|
end
|
|
379
567
|
|
|
380
|
-
#
|
|
381
|
-
#
|
|
568
|
+
# Create Profile Schema Relationship
|
|
569
|
+
# Create a relationship between an object schema and a profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_profile_schema_relationship.json)
|
|
570
|
+
# @param id [String] The ULID ID of the object schema.
|
|
571
|
+
# @param profile_object_schema_relationship_create_query [ProfileObjectSchemaRelationshipCreateQuery] Create a relationship between an object schema and a profile.
|
|
382
572
|
# @param [Hash] opts the optional parameters
|
|
383
|
-
# @
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
def get_data_sources(opts = {})
|
|
388
|
-
data, _status_code, _headers = get_data_sources_with_http_info(opts)
|
|
389
|
-
data
|
|
573
|
+
# @return [nil]
|
|
574
|
+
def create_profile_schema_relationship(id, profile_object_schema_relationship_create_query, opts = {})
|
|
575
|
+
create_profile_schema_relationship_with_http_info(id, profile_object_schema_relationship_create_query, opts)
|
|
576
|
+
nil
|
|
390
577
|
end
|
|
391
578
|
|
|
392
|
-
#
|
|
393
|
-
|
|
579
|
+
# alias of `create_profile_schema_relationship`
|
|
580
|
+
alias add_profile_object_schemas_to_object_schema create_profile_schema_relationship
|
|
581
|
+
|
|
582
|
+
# alias of `create_profile_schema_relationship`
|
|
583
|
+
alias create_object_schema_relationships_profile_object_schemas create_profile_schema_relationship
|
|
584
|
+
|
|
585
|
+
# Create Profile Schema Relationship
|
|
586
|
+
# Create a relationship between an object schema and a profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_profile_schema_relationship.json)
|
|
587
|
+
# @param id [String] The ULID ID of the object schema.
|
|
588
|
+
# @param profile_object_schema_relationship_create_query [ProfileObjectSchemaRelationshipCreateQuery] Create a relationship between an object schema and a profile.
|
|
394
589
|
# @param [Hash] opts the optional parameters
|
|
395
|
-
# @
|
|
396
|
-
|
|
397
|
-
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
398
|
-
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
399
|
-
def get_data_sources_with_http_info(opts = {})
|
|
590
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
591
|
+
def create_profile_schema_relationship_with_http_info(id, profile_object_schema_relationship_create_query, opts = {})
|
|
400
592
|
if @api_client.config.debugging
|
|
401
|
-
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.
|
|
593
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.create_profile_schema_relationship ...'
|
|
402
594
|
end
|
|
403
|
-
|
|
404
|
-
if @api_client.config.client_side_validation &&
|
|
405
|
-
fail ArgumentError, "
|
|
595
|
+
# verify the required parameter 'id' is set
|
|
596
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
597
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.create_profile_schema_relationship"
|
|
406
598
|
end
|
|
407
|
-
|
|
408
|
-
|
|
599
|
+
# verify the required parameter 'profile_object_schema_relationship_create_query' is set
|
|
600
|
+
if @api_client.config.client_side_validation && profile_object_schema_relationship_create_query.nil?
|
|
601
|
+
fail ArgumentError, "Missing the required parameter 'profile_object_schema_relationship_create_query' when calling CustomObjectsApi.create_profile_schema_relationship"
|
|
409
602
|
end
|
|
603
|
+
# resource path
|
|
604
|
+
local_var_path = '/api/object-schemas/{id}/relationships/profile-object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
410
605
|
|
|
411
|
-
|
|
412
|
-
|
|
606
|
+
# query parameters
|
|
607
|
+
query_params = opts[:query_params] || {}
|
|
608
|
+
|
|
609
|
+
# header parameters
|
|
610
|
+
header_params = opts[:header_params] || {}
|
|
611
|
+
# klaviyo api revision
|
|
612
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
613
|
+
# HTTP header 'Accept' (if needed)
|
|
614
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
615
|
+
# HTTP header 'Content-Type'
|
|
616
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
617
|
+
if !content_type.nil?
|
|
618
|
+
header_params['Content-Type'] = content_type
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
# form parameters
|
|
622
|
+
form_params = opts[:form_params] || {}
|
|
623
|
+
|
|
624
|
+
# http body (model)
|
|
625
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_object_schema_relationship_create_query)
|
|
626
|
+
|
|
627
|
+
# return_type
|
|
628
|
+
return_type = opts[:debug_return_type]
|
|
629
|
+
|
|
630
|
+
# auth_names
|
|
631
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
632
|
+
|
|
633
|
+
new_options = opts.merge(
|
|
634
|
+
:operation => :"CustomObjectsApi.create_profile_schema_relationship",
|
|
635
|
+
:header_params => header_params,
|
|
636
|
+
:query_params => query_params,
|
|
637
|
+
:form_params => form_params,
|
|
638
|
+
:body => post_body,
|
|
639
|
+
:auth_names => auth_names,
|
|
640
|
+
:return_type => return_type
|
|
641
|
+
)
|
|
642
|
+
|
|
643
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
644
|
+
if @api_client.config.debugging
|
|
645
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#create_profile_schema_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
413
646
|
end
|
|
647
|
+
return data, status_code, headers
|
|
648
|
+
end
|
|
414
649
|
|
|
650
|
+
# alias of `create_profile_schema_relationship_with_http_info`
|
|
651
|
+
alias add_profile_object_schemas_to_object_schema_with_http_info create_profile_schema_relationship_with_http_info
|
|
652
|
+
|
|
653
|
+
# alias of `create_profile_schema_relationship_with_http_info`
|
|
654
|
+
alias create_object_schema_relationships_profile_object_schemas_with_http_info create_profile_schema_relationship_with_http_info
|
|
655
|
+
|
|
656
|
+
# Delete Data Source
|
|
657
|
+
# Delete a data source in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_data_source.json)
|
|
658
|
+
# @param id [String] The ID of the data source to delete
|
|
659
|
+
# @param [Hash] opts the optional parameters
|
|
660
|
+
# @return [nil]
|
|
661
|
+
def delete_data_source(id, opts = {})
|
|
662
|
+
delete_data_source_with_http_info(id, opts)
|
|
663
|
+
nil
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
# Delete Data Source
|
|
667
|
+
# Delete a data source in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_data_source.json)
|
|
668
|
+
# @param id [String] The ID of the data source to delete
|
|
669
|
+
# @param [Hash] opts the optional parameters
|
|
670
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
671
|
+
def delete_data_source_with_http_info(id, opts = {})
|
|
672
|
+
if @api_client.config.debugging
|
|
673
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.delete_data_source ...'
|
|
674
|
+
end
|
|
675
|
+
# verify the required parameter 'id' is set
|
|
676
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
677
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.delete_data_source"
|
|
678
|
+
end
|
|
415
679
|
# resource path
|
|
416
|
-
local_var_path = '/api/data-sources'
|
|
680
|
+
local_var_path = '/api/data-sources/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
417
681
|
|
|
418
682
|
# query parameters
|
|
419
683
|
query_params = opts[:query_params] || {}
|
|
420
|
-
query_params[:'fields[data-source]'] = @api_client.build_collection_param(opts[:'fields_data_source'], :csv) if !opts[:'fields_data_source'].nil?
|
|
421
|
-
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
422
|
-
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
423
684
|
|
|
424
685
|
# header parameters
|
|
425
686
|
header_params = opts[:header_params] || {}
|
|
426
687
|
# klaviyo api revision
|
|
427
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
688
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
428
689
|
# HTTP header 'Accept' (if needed)
|
|
429
690
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
430
691
|
|
|
@@ -435,13 +696,2079 @@ module KlaviyoAPI
|
|
|
435
696
|
post_body = opts[:debug_body]
|
|
436
697
|
|
|
437
698
|
# return_type
|
|
438
|
-
return_type = opts[:debug_return_type]
|
|
699
|
+
return_type = opts[:debug_return_type]
|
|
439
700
|
|
|
440
701
|
# auth_names
|
|
441
702
|
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
442
703
|
|
|
443
704
|
new_options = opts.merge(
|
|
444
|
-
:operation => :"CustomObjectsApi.
|
|
705
|
+
:operation => :"CustomObjectsApi.delete_data_source",
|
|
706
|
+
:header_params => header_params,
|
|
707
|
+
:query_params => query_params,
|
|
708
|
+
:form_params => form_params,
|
|
709
|
+
:body => post_body,
|
|
710
|
+
:auth_names => auth_names,
|
|
711
|
+
:return_type => return_type
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
715
|
+
if @api_client.config.debugging
|
|
716
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#delete_data_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
717
|
+
end
|
|
718
|
+
return data, status_code, headers
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
# Delete Object Schema Relationship
|
|
722
|
+
# Delete a relationship between object schemas<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_object_schema_relationship.json)
|
|
723
|
+
# @param id [String] The ULID ID of the object schema.
|
|
724
|
+
# @param object_schema_relationship_delete_query [ObjectSchemaRelationshipDeleteQuery] Delete a relationship between object schemas
|
|
725
|
+
# @param [Hash] opts the optional parameters
|
|
726
|
+
# @return [nil]
|
|
727
|
+
def delete_object_schema_relationship(id, object_schema_relationship_delete_query, opts = {})
|
|
728
|
+
delete_object_schema_relationship_with_http_info(id, object_schema_relationship_delete_query, opts)
|
|
729
|
+
nil
|
|
730
|
+
end
|
|
731
|
+
|
|
732
|
+
# alias of `delete_object_schema_relationship`
|
|
733
|
+
alias delete_object_schema_relationships_schemas delete_object_schema_relationship
|
|
734
|
+
|
|
735
|
+
# alias of `delete_object_schema_relationship`
|
|
736
|
+
alias remove_schemas_from_object_schema delete_object_schema_relationship
|
|
737
|
+
|
|
738
|
+
# Delete Object Schema Relationship
|
|
739
|
+
# Delete a relationship between object schemas<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_object_schema_relationship.json)
|
|
740
|
+
# @param id [String] The ULID ID of the object schema.
|
|
741
|
+
# @param object_schema_relationship_delete_query [ObjectSchemaRelationshipDeleteQuery] Delete a relationship between object schemas
|
|
742
|
+
# @param [Hash] opts the optional parameters
|
|
743
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
744
|
+
def delete_object_schema_relationship_with_http_info(id, object_schema_relationship_delete_query, opts = {})
|
|
745
|
+
if @api_client.config.debugging
|
|
746
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.delete_object_schema_relationship ...'
|
|
747
|
+
end
|
|
748
|
+
# verify the required parameter 'id' is set
|
|
749
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
750
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.delete_object_schema_relationship"
|
|
751
|
+
end
|
|
752
|
+
# verify the required parameter 'object_schema_relationship_delete_query' is set
|
|
753
|
+
if @api_client.config.client_side_validation && object_schema_relationship_delete_query.nil?
|
|
754
|
+
fail ArgumentError, "Missing the required parameter 'object_schema_relationship_delete_query' when calling CustomObjectsApi.delete_object_schema_relationship"
|
|
755
|
+
end
|
|
756
|
+
# resource path
|
|
757
|
+
local_var_path = '/api/object-schemas/{id}/relationships/object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
758
|
+
|
|
759
|
+
# query parameters
|
|
760
|
+
query_params = opts[:query_params] || {}
|
|
761
|
+
|
|
762
|
+
# header parameters
|
|
763
|
+
header_params = opts[:header_params] || {}
|
|
764
|
+
# klaviyo api revision
|
|
765
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
766
|
+
# HTTP header 'Accept' (if needed)
|
|
767
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
768
|
+
# HTTP header 'Content-Type'
|
|
769
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
770
|
+
if !content_type.nil?
|
|
771
|
+
header_params['Content-Type'] = content_type
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
# form parameters
|
|
775
|
+
form_params = opts[:form_params] || {}
|
|
776
|
+
|
|
777
|
+
# http body (model)
|
|
778
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_schema_relationship_delete_query)
|
|
779
|
+
|
|
780
|
+
# return_type
|
|
781
|
+
return_type = opts[:debug_return_type]
|
|
782
|
+
|
|
783
|
+
# auth_names
|
|
784
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
785
|
+
|
|
786
|
+
new_options = opts.merge(
|
|
787
|
+
:operation => :"CustomObjectsApi.delete_object_schema_relationship",
|
|
788
|
+
:header_params => header_params,
|
|
789
|
+
:query_params => query_params,
|
|
790
|
+
:form_params => form_params,
|
|
791
|
+
:body => post_body,
|
|
792
|
+
:auth_names => auth_names,
|
|
793
|
+
:return_type => return_type
|
|
794
|
+
)
|
|
795
|
+
|
|
796
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
797
|
+
if @api_client.config.debugging
|
|
798
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#delete_object_schema_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
799
|
+
end
|
|
800
|
+
return data, status_code, headers
|
|
801
|
+
end
|
|
802
|
+
|
|
803
|
+
# alias of `delete_object_schema_relationship_with_http_info`
|
|
804
|
+
alias delete_object_schema_relationships_schemas_with_http_info delete_object_schema_relationship_with_http_info
|
|
805
|
+
|
|
806
|
+
# alias of `delete_object_schema_relationship_with_http_info`
|
|
807
|
+
alias remove_schemas_from_object_schema_with_http_info delete_object_schema_relationship_with_http_info
|
|
808
|
+
|
|
809
|
+
# Delete Object Type
|
|
810
|
+
# Delete the object type with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_object_type.json)
|
|
811
|
+
# @param id [String] The ULID ID of the object type.
|
|
812
|
+
# @param [Hash] opts the optional parameters
|
|
813
|
+
# @return [nil]
|
|
814
|
+
def delete_object_type(id, opts = {})
|
|
815
|
+
delete_object_type_with_http_info(id, opts)
|
|
816
|
+
nil
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
# Delete Object Type
|
|
820
|
+
# Delete the object type with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_object_type.json)
|
|
821
|
+
# @param id [String] The ULID ID of the object type.
|
|
822
|
+
# @param [Hash] opts the optional parameters
|
|
823
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
824
|
+
def delete_object_type_with_http_info(id, opts = {})
|
|
825
|
+
if @api_client.config.debugging
|
|
826
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.delete_object_type ...'
|
|
827
|
+
end
|
|
828
|
+
# verify the required parameter 'id' is set
|
|
829
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
830
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.delete_object_type"
|
|
831
|
+
end
|
|
832
|
+
# resource path
|
|
833
|
+
local_var_path = '/api/object-types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
834
|
+
|
|
835
|
+
# query parameters
|
|
836
|
+
query_params = opts[:query_params] || {}
|
|
837
|
+
|
|
838
|
+
# header parameters
|
|
839
|
+
header_params = opts[:header_params] || {}
|
|
840
|
+
# klaviyo api revision
|
|
841
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
842
|
+
# HTTP header 'Accept' (if needed)
|
|
843
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
844
|
+
|
|
845
|
+
# form parameters
|
|
846
|
+
form_params = opts[:form_params] || {}
|
|
847
|
+
|
|
848
|
+
# http body (model)
|
|
849
|
+
post_body = opts[:debug_body]
|
|
850
|
+
|
|
851
|
+
# return_type
|
|
852
|
+
return_type = opts[:debug_return_type]
|
|
853
|
+
|
|
854
|
+
# auth_names
|
|
855
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
856
|
+
|
|
857
|
+
new_options = opts.merge(
|
|
858
|
+
:operation => :"CustomObjectsApi.delete_object_type",
|
|
859
|
+
:header_params => header_params,
|
|
860
|
+
:query_params => query_params,
|
|
861
|
+
:form_params => form_params,
|
|
862
|
+
:body => post_body,
|
|
863
|
+
:auth_names => auth_names,
|
|
864
|
+
:return_type => return_type
|
|
865
|
+
)
|
|
866
|
+
|
|
867
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
868
|
+
if @api_client.config.debugging
|
|
869
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#delete_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
870
|
+
end
|
|
871
|
+
return data, status_code, headers
|
|
872
|
+
end
|
|
873
|
+
|
|
874
|
+
# Delete Profile Schema Relationship
|
|
875
|
+
# Delete a relationship between an object schema and a profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_profile_schema_relationship.json)
|
|
876
|
+
# @param id [String] The ULID ID of the object schema.
|
|
877
|
+
# @param profile_object_schema_relationship_delete_query [ProfileObjectSchemaRelationshipDeleteQuery] Delete a relationship between an object schema and a profile
|
|
878
|
+
# @param [Hash] opts the optional parameters
|
|
879
|
+
# @return [nil]
|
|
880
|
+
def delete_profile_schema_relationship(id, profile_object_schema_relationship_delete_query, opts = {})
|
|
881
|
+
delete_profile_schema_relationship_with_http_info(id, profile_object_schema_relationship_delete_query, opts)
|
|
882
|
+
nil
|
|
883
|
+
end
|
|
884
|
+
|
|
885
|
+
# alias of `delete_profile_schema_relationship`
|
|
886
|
+
alias delete_object_schema_relationships_profile_object_schemas delete_profile_schema_relationship
|
|
887
|
+
|
|
888
|
+
# alias of `delete_profile_schema_relationship`
|
|
889
|
+
alias remove_profile_object_schemas_from_object_schema delete_profile_schema_relationship
|
|
890
|
+
|
|
891
|
+
# Delete Profile Schema Relationship
|
|
892
|
+
# Delete a relationship between an object schema and a profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_profile_schema_relationship.json)
|
|
893
|
+
# @param id [String] The ULID ID of the object schema.
|
|
894
|
+
# @param profile_object_schema_relationship_delete_query [ProfileObjectSchemaRelationshipDeleteQuery] Delete a relationship between an object schema and a profile
|
|
895
|
+
# @param [Hash] opts the optional parameters
|
|
896
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
897
|
+
def delete_profile_schema_relationship_with_http_info(id, profile_object_schema_relationship_delete_query, opts = {})
|
|
898
|
+
if @api_client.config.debugging
|
|
899
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.delete_profile_schema_relationship ...'
|
|
900
|
+
end
|
|
901
|
+
# verify the required parameter 'id' is set
|
|
902
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
903
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.delete_profile_schema_relationship"
|
|
904
|
+
end
|
|
905
|
+
# verify the required parameter 'profile_object_schema_relationship_delete_query' is set
|
|
906
|
+
if @api_client.config.client_side_validation && profile_object_schema_relationship_delete_query.nil?
|
|
907
|
+
fail ArgumentError, "Missing the required parameter 'profile_object_schema_relationship_delete_query' when calling CustomObjectsApi.delete_profile_schema_relationship"
|
|
908
|
+
end
|
|
909
|
+
# resource path
|
|
910
|
+
local_var_path = '/api/object-schemas/{id}/relationships/profile-object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
911
|
+
|
|
912
|
+
# query parameters
|
|
913
|
+
query_params = opts[:query_params] || {}
|
|
914
|
+
|
|
915
|
+
# header parameters
|
|
916
|
+
header_params = opts[:header_params] || {}
|
|
917
|
+
# klaviyo api revision
|
|
918
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
919
|
+
# HTTP header 'Accept' (if needed)
|
|
920
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
921
|
+
# HTTP header 'Content-Type'
|
|
922
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
923
|
+
if !content_type.nil?
|
|
924
|
+
header_params['Content-Type'] = content_type
|
|
925
|
+
end
|
|
926
|
+
|
|
927
|
+
# form parameters
|
|
928
|
+
form_params = opts[:form_params] || {}
|
|
929
|
+
|
|
930
|
+
# http body (model)
|
|
931
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_object_schema_relationship_delete_query)
|
|
932
|
+
|
|
933
|
+
# return_type
|
|
934
|
+
return_type = opts[:debug_return_type]
|
|
935
|
+
|
|
936
|
+
# auth_names
|
|
937
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
938
|
+
|
|
939
|
+
new_options = opts.merge(
|
|
940
|
+
:operation => :"CustomObjectsApi.delete_profile_schema_relationship",
|
|
941
|
+
:header_params => header_params,
|
|
942
|
+
:query_params => query_params,
|
|
943
|
+
:form_params => form_params,
|
|
944
|
+
:body => post_body,
|
|
945
|
+
:auth_names => auth_names,
|
|
946
|
+
:return_type => return_type
|
|
947
|
+
)
|
|
948
|
+
|
|
949
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
950
|
+
if @api_client.config.debugging
|
|
951
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#delete_profile_schema_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
952
|
+
end
|
|
953
|
+
return data, status_code, headers
|
|
954
|
+
end
|
|
955
|
+
|
|
956
|
+
# alias of `delete_profile_schema_relationship_with_http_info`
|
|
957
|
+
alias delete_object_schema_relationships_profile_object_schemas_with_http_info delete_profile_schema_relationship_with_http_info
|
|
958
|
+
|
|
959
|
+
# alias of `delete_profile_schema_relationship_with_http_info`
|
|
960
|
+
alias remove_profile_object_schemas_from_object_schema_with_http_info delete_profile_schema_relationship_with_http_info
|
|
961
|
+
|
|
962
|
+
# Get Current Schema for Object Type
|
|
963
|
+
# Get current schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_current_schema_for_object_type.json)
|
|
964
|
+
# @param id [String] The ULID ID of the object type.
|
|
965
|
+
# @param [Hash] opts the optional parameters
|
|
966
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
967
|
+
# @return [Hash<String, Object>]
|
|
968
|
+
def get_current_schema_for_object_type(id, opts = {})
|
|
969
|
+
data, _status_code, _headers = get_current_schema_for_object_type_with_http_info(id, opts)
|
|
970
|
+
data
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
# alias of `get_current_schema_for_object_type`
|
|
974
|
+
alias get_object_type_current_schema get_current_schema_for_object_type
|
|
975
|
+
|
|
976
|
+
# Get Current Schema for Object Type
|
|
977
|
+
# Get current schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_current_schema_for_object_type.json)
|
|
978
|
+
# @param id [String] The ULID ID of the object type.
|
|
979
|
+
# @param [Hash] opts the optional parameters
|
|
980
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
981
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
982
|
+
def get_current_schema_for_object_type_with_http_info(id, opts = {})
|
|
983
|
+
if @api_client.config.debugging
|
|
984
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_current_schema_for_object_type ...'
|
|
985
|
+
end
|
|
986
|
+
# verify the required parameter 'id' is set
|
|
987
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
988
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_current_schema_for_object_type"
|
|
989
|
+
end
|
|
990
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
991
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
992
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
993
|
+
end
|
|
994
|
+
# resource path
|
|
995
|
+
local_var_path = '/api/object-types/{id}/current-schema'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
996
|
+
|
|
997
|
+
# query parameters
|
|
998
|
+
query_params = opts[:query_params] || {}
|
|
999
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
1000
|
+
|
|
1001
|
+
# header parameters
|
|
1002
|
+
header_params = opts[:header_params] || {}
|
|
1003
|
+
# klaviyo api revision
|
|
1004
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1005
|
+
# HTTP header 'Accept' (if needed)
|
|
1006
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1007
|
+
|
|
1008
|
+
# form parameters
|
|
1009
|
+
form_params = opts[:form_params] || {}
|
|
1010
|
+
|
|
1011
|
+
# http body (model)
|
|
1012
|
+
post_body = opts[:debug_body]
|
|
1013
|
+
|
|
1014
|
+
# return_type
|
|
1015
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1016
|
+
|
|
1017
|
+
# auth_names
|
|
1018
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1019
|
+
|
|
1020
|
+
new_options = opts.merge(
|
|
1021
|
+
:operation => :"CustomObjectsApi.get_current_schema_for_object_type",
|
|
1022
|
+
:header_params => header_params,
|
|
1023
|
+
:query_params => query_params,
|
|
1024
|
+
:form_params => form_params,
|
|
1025
|
+
:body => post_body,
|
|
1026
|
+
:auth_names => auth_names,
|
|
1027
|
+
:return_type => return_type
|
|
1028
|
+
)
|
|
1029
|
+
|
|
1030
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1031
|
+
if @api_client.config.debugging
|
|
1032
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_current_schema_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1033
|
+
end
|
|
1034
|
+
return data, status_code, headers
|
|
1035
|
+
end
|
|
1036
|
+
|
|
1037
|
+
# alias of `get_current_schema_for_object_type_with_http_info`
|
|
1038
|
+
alias get_object_type_current_schema_with_http_info get_current_schema_for_object_type_with_http_info
|
|
1039
|
+
|
|
1040
|
+
# Get Current Schema ID for Object Type
|
|
1041
|
+
# Get current schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_current_schema_id_for_object_type.json)
|
|
1042
|
+
# @param id [String] The ULID ID of the object type.
|
|
1043
|
+
# @param [Hash] opts the optional parameters
|
|
1044
|
+
# @return [Hash<String, Object>]
|
|
1045
|
+
def get_current_schema_id_for_object_type(id, opts = {})
|
|
1046
|
+
data, _status_code, _headers = get_current_schema_id_for_object_type_with_http_info(id, opts)
|
|
1047
|
+
data
|
|
1048
|
+
end
|
|
1049
|
+
|
|
1050
|
+
# alias of `get_current_schema_id_for_object_type`
|
|
1051
|
+
alias get_object_type_relationships_current_schema get_current_schema_id_for_object_type
|
|
1052
|
+
|
|
1053
|
+
# Get Current Schema ID for Object Type
|
|
1054
|
+
# Get current schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_current_schema_id_for_object_type.json)
|
|
1055
|
+
# @param id [String] The ULID ID of the object type.
|
|
1056
|
+
# @param [Hash] opts the optional parameters
|
|
1057
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1058
|
+
def get_current_schema_id_for_object_type_with_http_info(id, opts = {})
|
|
1059
|
+
if @api_client.config.debugging
|
|
1060
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_current_schema_id_for_object_type ...'
|
|
1061
|
+
end
|
|
1062
|
+
# verify the required parameter 'id' is set
|
|
1063
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1064
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_current_schema_id_for_object_type"
|
|
1065
|
+
end
|
|
1066
|
+
# resource path
|
|
1067
|
+
local_var_path = '/api/object-types/{id}/relationships/current-schema'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1068
|
+
|
|
1069
|
+
# query parameters
|
|
1070
|
+
query_params = opts[:query_params] || {}
|
|
1071
|
+
|
|
1072
|
+
# header parameters
|
|
1073
|
+
header_params = opts[:header_params] || {}
|
|
1074
|
+
# klaviyo api revision
|
|
1075
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1076
|
+
# HTTP header 'Accept' (if needed)
|
|
1077
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1078
|
+
|
|
1079
|
+
# form parameters
|
|
1080
|
+
form_params = opts[:form_params] || {}
|
|
1081
|
+
|
|
1082
|
+
# http body (model)
|
|
1083
|
+
post_body = opts[:debug_body]
|
|
1084
|
+
|
|
1085
|
+
# return_type
|
|
1086
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1087
|
+
|
|
1088
|
+
# auth_names
|
|
1089
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1090
|
+
|
|
1091
|
+
new_options = opts.merge(
|
|
1092
|
+
:operation => :"CustomObjectsApi.get_current_schema_id_for_object_type",
|
|
1093
|
+
:header_params => header_params,
|
|
1094
|
+
:query_params => query_params,
|
|
1095
|
+
:form_params => form_params,
|
|
1096
|
+
:body => post_body,
|
|
1097
|
+
:auth_names => auth_names,
|
|
1098
|
+
:return_type => return_type
|
|
1099
|
+
)
|
|
1100
|
+
|
|
1101
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1102
|
+
if @api_client.config.debugging
|
|
1103
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_current_schema_id_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1104
|
+
end
|
|
1105
|
+
return data, status_code, headers
|
|
1106
|
+
end
|
|
1107
|
+
|
|
1108
|
+
# alias of `get_current_schema_id_for_object_type_with_http_info`
|
|
1109
|
+
alias get_object_type_relationships_current_schema_with_http_info get_current_schema_id_for_object_type_with_http_info
|
|
1110
|
+
|
|
1111
|
+
# Get Data Source
|
|
1112
|
+
# Retrieve a data source in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_data_source.json)
|
|
1113
|
+
# @param id [String] The ID of the data source
|
|
1114
|
+
# @param [Hash] opts the optional parameters
|
|
1115
|
+
# @option opts [Array<String>] :fields_data_source For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1116
|
+
# @return [Hash<String, Object>]
|
|
1117
|
+
def get_data_source(id, opts = {})
|
|
1118
|
+
data, _status_code, _headers = get_data_source_with_http_info(id, opts)
|
|
1119
|
+
data
|
|
1120
|
+
end
|
|
1121
|
+
|
|
1122
|
+
# Get Data Source
|
|
1123
|
+
# Retrieve a data source in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_data_source.json)
|
|
1124
|
+
# @param id [String] The ID of the data source
|
|
1125
|
+
# @param [Hash] opts the optional parameters
|
|
1126
|
+
# @option opts [Array<String>] :fields_data_source For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1127
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1128
|
+
def get_data_source_with_http_info(id, opts = {})
|
|
1129
|
+
if @api_client.config.debugging
|
|
1130
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_data_source ...'
|
|
1131
|
+
end
|
|
1132
|
+
# verify the required parameter 'id' is set
|
|
1133
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1134
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_data_source"
|
|
1135
|
+
end
|
|
1136
|
+
allowable_values = ["description", "id", "namespace", "title", "visibility"]
|
|
1137
|
+
if @api_client.config.client_side_validation && opts[:'fields_data_source'] && !opts[:'fields_data_source'].all? { |item| allowable_values.include?(item) }
|
|
1138
|
+
fail ArgumentError, "invalid value for \"fields_data_source\", must include one of #{allowable_values}"
|
|
1139
|
+
end
|
|
1140
|
+
# resource path
|
|
1141
|
+
local_var_path = '/api/data-sources/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1142
|
+
|
|
1143
|
+
# query parameters
|
|
1144
|
+
query_params = opts[:query_params] || {}
|
|
1145
|
+
query_params[:'fields[data-source]'] = @api_client.build_collection_param(opts[:'fields_data_source'], :csv) if !opts[:'fields_data_source'].nil?
|
|
1146
|
+
|
|
1147
|
+
# header parameters
|
|
1148
|
+
header_params = opts[:header_params] || {}
|
|
1149
|
+
# klaviyo api revision
|
|
1150
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1151
|
+
# HTTP header 'Accept' (if needed)
|
|
1152
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1153
|
+
|
|
1154
|
+
# form parameters
|
|
1155
|
+
form_params = opts[:form_params] || {}
|
|
1156
|
+
|
|
1157
|
+
# http body (model)
|
|
1158
|
+
post_body = opts[:debug_body]
|
|
1159
|
+
|
|
1160
|
+
# return_type
|
|
1161
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1162
|
+
|
|
1163
|
+
# auth_names
|
|
1164
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1165
|
+
|
|
1166
|
+
new_options = opts.merge(
|
|
1167
|
+
:operation => :"CustomObjectsApi.get_data_source",
|
|
1168
|
+
:header_params => header_params,
|
|
1169
|
+
:query_params => query_params,
|
|
1170
|
+
:form_params => form_params,
|
|
1171
|
+
:body => post_body,
|
|
1172
|
+
:auth_names => auth_names,
|
|
1173
|
+
:return_type => return_type
|
|
1174
|
+
)
|
|
1175
|
+
|
|
1176
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1177
|
+
if @api_client.config.debugging
|
|
1178
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_data_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1179
|
+
end
|
|
1180
|
+
return data, status_code, headers
|
|
1181
|
+
end
|
|
1182
|
+
|
|
1183
|
+
# Get Data Sources
|
|
1184
|
+
# Get all data sources in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_data_sources.json)
|
|
1185
|
+
# @param [Hash] opts the optional parameters
|
|
1186
|
+
# @option opts [Array<String>] :fields_data_source For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1187
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1188
|
+
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
1189
|
+
# @return [Hash<String, Object>]
|
|
1190
|
+
def get_data_sources(opts = {})
|
|
1191
|
+
data, _status_code, _headers = get_data_sources_with_http_info(opts)
|
|
1192
|
+
data
|
|
1193
|
+
end
|
|
1194
|
+
|
|
1195
|
+
# Get Data Sources
|
|
1196
|
+
# Get all data sources in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_data_sources.json)
|
|
1197
|
+
# @param [Hash] opts the optional parameters
|
|
1198
|
+
# @option opts [Array<String>] :fields_data_source For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1199
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1200
|
+
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
1201
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1202
|
+
def get_data_sources_with_http_info(opts = {})
|
|
1203
|
+
if @api_client.config.debugging
|
|
1204
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_data_sources ...'
|
|
1205
|
+
end
|
|
1206
|
+
allowable_values = ["description", "id", "namespace", "title", "visibility"]
|
|
1207
|
+
if @api_client.config.client_side_validation && opts[:'fields_data_source'] && !opts[:'fields_data_source'].all? { |item| allowable_values.include?(item) }
|
|
1208
|
+
fail ArgumentError, "invalid value for \"fields_data_source\", must include one of #{allowable_values}"
|
|
1209
|
+
end
|
|
1210
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
1211
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomObjectsApi.get_data_sources, must be smaller than or equal to 100.'
|
|
1212
|
+
end
|
|
1213
|
+
|
|
1214
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
1215
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomObjectsApi.get_data_sources, must be greater than or equal to 1.'
|
|
1216
|
+
end
|
|
1217
|
+
|
|
1218
|
+
# resource path
|
|
1219
|
+
local_var_path = '/api/data-sources'
|
|
1220
|
+
|
|
1221
|
+
# query parameters
|
|
1222
|
+
query_params = opts[:query_params] || {}
|
|
1223
|
+
query_params[:'fields[data-source]'] = @api_client.build_collection_param(opts[:'fields_data_source'], :csv) if !opts[:'fields_data_source'].nil?
|
|
1224
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
1225
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
1226
|
+
|
|
1227
|
+
# header parameters
|
|
1228
|
+
header_params = opts[:header_params] || {}
|
|
1229
|
+
# klaviyo api revision
|
|
1230
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1231
|
+
# HTTP header 'Accept' (if needed)
|
|
1232
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1233
|
+
|
|
1234
|
+
# form parameters
|
|
1235
|
+
form_params = opts[:form_params] || {}
|
|
1236
|
+
|
|
1237
|
+
# http body (model)
|
|
1238
|
+
post_body = opts[:debug_body]
|
|
1239
|
+
|
|
1240
|
+
# return_type
|
|
1241
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1242
|
+
|
|
1243
|
+
# auth_names
|
|
1244
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1245
|
+
|
|
1246
|
+
new_options = opts.merge(
|
|
1247
|
+
:operation => :"CustomObjectsApi.get_data_sources",
|
|
1248
|
+
:header_params => header_params,
|
|
1249
|
+
:query_params => query_params,
|
|
1250
|
+
:form_params => form_params,
|
|
1251
|
+
:body => post_body,
|
|
1252
|
+
:auth_names => auth_names,
|
|
1253
|
+
:return_type => return_type
|
|
1254
|
+
)
|
|
1255
|
+
|
|
1256
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1257
|
+
if @api_client.config.debugging
|
|
1258
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_data_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1259
|
+
end
|
|
1260
|
+
return data, status_code, headers
|
|
1261
|
+
end
|
|
1262
|
+
|
|
1263
|
+
# Get Draft Schema for Object Type
|
|
1264
|
+
# Get draft schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_draft_schema_for_object_type.json)
|
|
1265
|
+
# @param id [String] The ULID ID of the object type.
|
|
1266
|
+
# @param [Hash] opts the optional parameters
|
|
1267
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1268
|
+
# @return [Hash<String, Object>]
|
|
1269
|
+
def get_draft_schema_for_object_type(id, opts = {})
|
|
1270
|
+
data, _status_code, _headers = get_draft_schema_for_object_type_with_http_info(id, opts)
|
|
1271
|
+
data
|
|
1272
|
+
end
|
|
1273
|
+
|
|
1274
|
+
# alias of `get_draft_schema_for_object_type`
|
|
1275
|
+
alias get_object_type_draft_schema get_draft_schema_for_object_type
|
|
1276
|
+
|
|
1277
|
+
# Get Draft Schema for Object Type
|
|
1278
|
+
# Get draft schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_draft_schema_for_object_type.json)
|
|
1279
|
+
# @param id [String] The ULID ID of the object type.
|
|
1280
|
+
# @param [Hash] opts the optional parameters
|
|
1281
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1282
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1283
|
+
def get_draft_schema_for_object_type_with_http_info(id, opts = {})
|
|
1284
|
+
if @api_client.config.debugging
|
|
1285
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_draft_schema_for_object_type ...'
|
|
1286
|
+
end
|
|
1287
|
+
# verify the required parameter 'id' is set
|
|
1288
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1289
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_draft_schema_for_object_type"
|
|
1290
|
+
end
|
|
1291
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
1292
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
1293
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
1294
|
+
end
|
|
1295
|
+
# resource path
|
|
1296
|
+
local_var_path = '/api/object-types/{id}/draft-schema'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1297
|
+
|
|
1298
|
+
# query parameters
|
|
1299
|
+
query_params = opts[:query_params] || {}
|
|
1300
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
1301
|
+
|
|
1302
|
+
# header parameters
|
|
1303
|
+
header_params = opts[:header_params] || {}
|
|
1304
|
+
# klaviyo api revision
|
|
1305
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1306
|
+
# HTTP header 'Accept' (if needed)
|
|
1307
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1308
|
+
|
|
1309
|
+
# form parameters
|
|
1310
|
+
form_params = opts[:form_params] || {}
|
|
1311
|
+
|
|
1312
|
+
# http body (model)
|
|
1313
|
+
post_body = opts[:debug_body]
|
|
1314
|
+
|
|
1315
|
+
# return_type
|
|
1316
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1317
|
+
|
|
1318
|
+
# auth_names
|
|
1319
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1320
|
+
|
|
1321
|
+
new_options = opts.merge(
|
|
1322
|
+
:operation => :"CustomObjectsApi.get_draft_schema_for_object_type",
|
|
1323
|
+
:header_params => header_params,
|
|
1324
|
+
:query_params => query_params,
|
|
1325
|
+
:form_params => form_params,
|
|
1326
|
+
:body => post_body,
|
|
1327
|
+
:auth_names => auth_names,
|
|
1328
|
+
:return_type => return_type
|
|
1329
|
+
)
|
|
1330
|
+
|
|
1331
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1332
|
+
if @api_client.config.debugging
|
|
1333
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_draft_schema_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1334
|
+
end
|
|
1335
|
+
return data, status_code, headers
|
|
1336
|
+
end
|
|
1337
|
+
|
|
1338
|
+
# alias of `get_draft_schema_for_object_type_with_http_info`
|
|
1339
|
+
alias get_object_type_draft_schema_with_http_info get_draft_schema_for_object_type_with_http_info
|
|
1340
|
+
|
|
1341
|
+
# Get Draft Schema ID for Object Type
|
|
1342
|
+
# Get draft schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_draft_schema_id_for_object_type.json)
|
|
1343
|
+
# @param id [String] The ULID ID of the object type.
|
|
1344
|
+
# @param [Hash] opts the optional parameters
|
|
1345
|
+
# @return [Hash<String, Object>]
|
|
1346
|
+
def get_draft_schema_id_for_object_type(id, opts = {})
|
|
1347
|
+
data, _status_code, _headers = get_draft_schema_id_for_object_type_with_http_info(id, opts)
|
|
1348
|
+
data
|
|
1349
|
+
end
|
|
1350
|
+
|
|
1351
|
+
# alias of `get_draft_schema_id_for_object_type`
|
|
1352
|
+
alias get_object_type_relationships_draft_schema get_draft_schema_id_for_object_type
|
|
1353
|
+
|
|
1354
|
+
# Get Draft Schema ID for Object Type
|
|
1355
|
+
# Get draft schema for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_draft_schema_id_for_object_type.json)
|
|
1356
|
+
# @param id [String] The ULID ID of the object type.
|
|
1357
|
+
# @param [Hash] opts the optional parameters
|
|
1358
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1359
|
+
def get_draft_schema_id_for_object_type_with_http_info(id, opts = {})
|
|
1360
|
+
if @api_client.config.debugging
|
|
1361
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_draft_schema_id_for_object_type ...'
|
|
1362
|
+
end
|
|
1363
|
+
# verify the required parameter 'id' is set
|
|
1364
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1365
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_draft_schema_id_for_object_type"
|
|
1366
|
+
end
|
|
1367
|
+
# resource path
|
|
1368
|
+
local_var_path = '/api/object-types/{id}/relationships/draft-schema'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1369
|
+
|
|
1370
|
+
# query parameters
|
|
1371
|
+
query_params = opts[:query_params] || {}
|
|
1372
|
+
|
|
1373
|
+
# header parameters
|
|
1374
|
+
header_params = opts[:header_params] || {}
|
|
1375
|
+
# klaviyo api revision
|
|
1376
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1377
|
+
# HTTP header 'Accept' (if needed)
|
|
1378
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1379
|
+
|
|
1380
|
+
# form parameters
|
|
1381
|
+
form_params = opts[:form_params] || {}
|
|
1382
|
+
|
|
1383
|
+
# http body (model)
|
|
1384
|
+
post_body = opts[:debug_body]
|
|
1385
|
+
|
|
1386
|
+
# return_type
|
|
1387
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1388
|
+
|
|
1389
|
+
# auth_names
|
|
1390
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1391
|
+
|
|
1392
|
+
new_options = opts.merge(
|
|
1393
|
+
:operation => :"CustomObjectsApi.get_draft_schema_id_for_object_type",
|
|
1394
|
+
:header_params => header_params,
|
|
1395
|
+
:query_params => query_params,
|
|
1396
|
+
:form_params => form_params,
|
|
1397
|
+
:body => post_body,
|
|
1398
|
+
:auth_names => auth_names,
|
|
1399
|
+
:return_type => return_type
|
|
1400
|
+
)
|
|
1401
|
+
|
|
1402
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1403
|
+
if @api_client.config.debugging
|
|
1404
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_draft_schema_id_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1405
|
+
end
|
|
1406
|
+
return data, status_code, headers
|
|
1407
|
+
end
|
|
1408
|
+
|
|
1409
|
+
# alias of `get_draft_schema_id_for_object_type_with_http_info`
|
|
1410
|
+
alias get_object_type_relationships_draft_schema_with_http_info get_draft_schema_id_for_object_type_with_http_info
|
|
1411
|
+
|
|
1412
|
+
# Get Ingestion Log IDs for Object Type
|
|
1413
|
+
# Get the ingestion logs for a given object type. Only ingestion failures are logged — the absence of a log entry for a record does not mean the record was ingested successfully. Logs are retained for 14 days; time filters outside that window return an empty page. Results are returned newest first with a fixed page size of 50.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_ingestion_log_ids_for_object_type.json)
|
|
1414
|
+
# @param id [String] The ULID ID of the object type.
|
|
1415
|
+
# @param [Hash] opts the optional parameters
|
|
1416
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`record_id`: `equals`<br>`status`: `any`, `equals`<br>`event_type`: `any`, `equals`<br>`timestamp`: `greater-or-equal`, `less-than`
|
|
1417
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1418
|
+
# @return [Hash<String, Object>]
|
|
1419
|
+
def get_ingestion_log_ids_for_object_type(id, opts = {})
|
|
1420
|
+
data, _status_code, _headers = get_ingestion_log_ids_for_object_type_with_http_info(id, opts)
|
|
1421
|
+
data
|
|
1422
|
+
end
|
|
1423
|
+
|
|
1424
|
+
# alias of `get_ingestion_log_ids_for_object_type`
|
|
1425
|
+
alias get_object_type_relationships_ingestion_logs get_ingestion_log_ids_for_object_type
|
|
1426
|
+
|
|
1427
|
+
# Get Ingestion Log IDs for Object Type
|
|
1428
|
+
# Get the ingestion logs for a given object type. Only ingestion failures are logged — the absence of a log entry for a record does not mean the record was ingested successfully. Logs are retained for 14 days; time filters outside that window return an empty page. Results are returned newest first with a fixed page size of 50.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_ingestion_log_ids_for_object_type.json)
|
|
1429
|
+
# @param id [String] The ULID ID of the object type.
|
|
1430
|
+
# @param [Hash] opts the optional parameters
|
|
1431
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`record_id`: `equals`<br>`status`: `any`, `equals`<br>`event_type`: `any`, `equals`<br>`timestamp`: `greater-or-equal`, `less-than`
|
|
1432
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1433
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1434
|
+
def get_ingestion_log_ids_for_object_type_with_http_info(id, opts = {})
|
|
1435
|
+
if @api_client.config.debugging
|
|
1436
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_ingestion_log_ids_for_object_type ...'
|
|
1437
|
+
end
|
|
1438
|
+
# verify the required parameter 'id' is set
|
|
1439
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1440
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_ingestion_log_ids_for_object_type"
|
|
1441
|
+
end
|
|
1442
|
+
# resource path
|
|
1443
|
+
local_var_path = '/api/object-types/{id}/relationships/object-ingestion-logs'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1444
|
+
|
|
1445
|
+
# query parameters
|
|
1446
|
+
query_params = opts[:query_params] || {}
|
|
1447
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
1448
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
1449
|
+
|
|
1450
|
+
# header parameters
|
|
1451
|
+
header_params = opts[:header_params] || {}
|
|
1452
|
+
# klaviyo api revision
|
|
1453
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1454
|
+
# HTTP header 'Accept' (if needed)
|
|
1455
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1456
|
+
|
|
1457
|
+
# form parameters
|
|
1458
|
+
form_params = opts[:form_params] || {}
|
|
1459
|
+
|
|
1460
|
+
# http body (model)
|
|
1461
|
+
post_body = opts[:debug_body]
|
|
1462
|
+
|
|
1463
|
+
# return_type
|
|
1464
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1465
|
+
|
|
1466
|
+
# auth_names
|
|
1467
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1468
|
+
|
|
1469
|
+
new_options = opts.merge(
|
|
1470
|
+
:operation => :"CustomObjectsApi.get_ingestion_log_ids_for_object_type",
|
|
1471
|
+
:header_params => header_params,
|
|
1472
|
+
:query_params => query_params,
|
|
1473
|
+
:form_params => form_params,
|
|
1474
|
+
:body => post_body,
|
|
1475
|
+
:auth_names => auth_names,
|
|
1476
|
+
:return_type => return_type
|
|
1477
|
+
)
|
|
1478
|
+
|
|
1479
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1480
|
+
if @api_client.config.debugging
|
|
1481
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_ingestion_log_ids_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1482
|
+
end
|
|
1483
|
+
return data, status_code, headers
|
|
1484
|
+
end
|
|
1485
|
+
|
|
1486
|
+
# alias of `get_ingestion_log_ids_for_object_type_with_http_info`
|
|
1487
|
+
alias get_object_type_relationships_ingestion_logs_with_http_info get_ingestion_log_ids_for_object_type_with_http_info
|
|
1488
|
+
|
|
1489
|
+
# Get Ingestion Logs for Object Type
|
|
1490
|
+
# Get the ingestion logs for a given object type. Only ingestion failures are logged — the absence of a log entry for a record does not mean the record was ingested successfully. Logs are retained for 14 days; time filters outside that window return an empty page. Results are returned newest first with a fixed page size of 50.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_ingestion_logs_for_object_type.json)
|
|
1491
|
+
# @param id [String] The ULID ID of the object type.
|
|
1492
|
+
# @param [Hash] opts the optional parameters
|
|
1493
|
+
# @option opts [Array<String>] :fields_object_ingestion_log For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1494
|
+
# @option opts [Array<String>] :fields_object_record For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1495
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1496
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`record_id`: `equals`<br>`status`: `any`, `equals`<br>`event_type`: `any`, `equals`<br>`timestamp`: `greater-or-equal`, `less-than`
|
|
1497
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1498
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1499
|
+
# @return [Hash<String, Object>]
|
|
1500
|
+
def get_ingestion_logs_for_object_type(id, opts = {})
|
|
1501
|
+
data, _status_code, _headers = get_ingestion_logs_for_object_type_with_http_info(id, opts)
|
|
1502
|
+
data
|
|
1503
|
+
end
|
|
1504
|
+
|
|
1505
|
+
# alias of `get_ingestion_logs_for_object_type`
|
|
1506
|
+
alias get_object_type_ingestion_logs get_ingestion_logs_for_object_type
|
|
1507
|
+
|
|
1508
|
+
# Get Ingestion Logs for Object Type
|
|
1509
|
+
# Get the ingestion logs for a given object type. Only ingestion failures are logged — the absence of a log entry for a record does not mean the record was ingested successfully. Logs are retained for 14 days; time filters outside that window return an empty page. Results are returned newest first with a fixed page size of 50.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_ingestion_logs_for_object_type.json)
|
|
1510
|
+
# @param id [String] The ULID ID of the object type.
|
|
1511
|
+
# @param [Hash] opts the optional parameters
|
|
1512
|
+
# @option opts [Array<String>] :fields_object_ingestion_log For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1513
|
+
# @option opts [Array<String>] :fields_object_record For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1514
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1515
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`record_id`: `equals`<br>`status`: `any`, `equals`<br>`event_type`: `any`, `equals`<br>`timestamp`: `greater-or-equal`, `less-than`
|
|
1516
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1517
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1518
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1519
|
+
def get_ingestion_logs_for_object_type_with_http_info(id, opts = {})
|
|
1520
|
+
if @api_client.config.debugging
|
|
1521
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_ingestion_logs_for_object_type ...'
|
|
1522
|
+
end
|
|
1523
|
+
# verify the required parameter 'id' is set
|
|
1524
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1525
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_ingestion_logs_for_object_type"
|
|
1526
|
+
end
|
|
1527
|
+
allowable_values = ["errors", "event_type", "id", "status", "summary", "timestamp"]
|
|
1528
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_ingestion_log'] && !opts[:'fields_object_ingestion_log'].all? { |item| allowable_values.include?(item) }
|
|
1529
|
+
fail ArgumentError, "invalid value for \"fields_object_ingestion_log\", must include one of #{allowable_values}"
|
|
1530
|
+
end
|
|
1531
|
+
allowable_values = ["id", "record_properties"]
|
|
1532
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_record'] && !opts[:'fields_object_record'].all? { |item| allowable_values.include?(item) }
|
|
1533
|
+
fail ArgumentError, "invalid value for \"fields_object_record\", must include one of #{allowable_values}"
|
|
1534
|
+
end
|
|
1535
|
+
allowable_values = ["created_at", "description", "id", "namespace", "status", "title", "updated_at"]
|
|
1536
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_type'] && !opts[:'fields_object_type'].all? { |item| allowable_values.include?(item) }
|
|
1537
|
+
fail ArgumentError, "invalid value for \"fields_object_type\", must include one of #{allowable_values}"
|
|
1538
|
+
end
|
|
1539
|
+
allowable_values = ["object-record", "object-type"]
|
|
1540
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
|
1541
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
|
1542
|
+
end
|
|
1543
|
+
# resource path
|
|
1544
|
+
local_var_path = '/api/object-types/{id}/object-ingestion-logs'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1545
|
+
|
|
1546
|
+
# query parameters
|
|
1547
|
+
query_params = opts[:query_params] || {}
|
|
1548
|
+
query_params[:'fields[object-ingestion-log]'] = @api_client.build_collection_param(opts[:'fields_object_ingestion_log'], :csv) if !opts[:'fields_object_ingestion_log'].nil?
|
|
1549
|
+
query_params[:'fields[object-record]'] = @api_client.build_collection_param(opts[:'fields_object_record'], :csv) if !opts[:'fields_object_record'].nil?
|
|
1550
|
+
query_params[:'fields[object-type]'] = @api_client.build_collection_param(opts[:'fields_object_type'], :csv) if !opts[:'fields_object_type'].nil?
|
|
1551
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
1552
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
|
1553
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
1554
|
+
|
|
1555
|
+
# header parameters
|
|
1556
|
+
header_params = opts[:header_params] || {}
|
|
1557
|
+
# klaviyo api revision
|
|
1558
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1559
|
+
# HTTP header 'Accept' (if needed)
|
|
1560
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1561
|
+
|
|
1562
|
+
# form parameters
|
|
1563
|
+
form_params = opts[:form_params] || {}
|
|
1564
|
+
|
|
1565
|
+
# http body (model)
|
|
1566
|
+
post_body = opts[:debug_body]
|
|
1567
|
+
|
|
1568
|
+
# return_type
|
|
1569
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1570
|
+
|
|
1571
|
+
# auth_names
|
|
1572
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1573
|
+
|
|
1574
|
+
new_options = opts.merge(
|
|
1575
|
+
:operation => :"CustomObjectsApi.get_ingestion_logs_for_object_type",
|
|
1576
|
+
:header_params => header_params,
|
|
1577
|
+
:query_params => query_params,
|
|
1578
|
+
:form_params => form_params,
|
|
1579
|
+
:body => post_body,
|
|
1580
|
+
:auth_names => auth_names,
|
|
1581
|
+
:return_type => return_type
|
|
1582
|
+
)
|
|
1583
|
+
|
|
1584
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1585
|
+
if @api_client.config.debugging
|
|
1586
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_ingestion_logs_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1587
|
+
end
|
|
1588
|
+
return data, status_code, headers
|
|
1589
|
+
end
|
|
1590
|
+
|
|
1591
|
+
# alias of `get_ingestion_logs_for_object_type_with_http_info`
|
|
1592
|
+
alias get_object_type_ingestion_logs_with_http_info get_ingestion_logs_for_object_type_with_http_info
|
|
1593
|
+
|
|
1594
|
+
# Get Object Record
|
|
1595
|
+
# Get the object record with the given compound ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_record.json)
|
|
1596
|
+
# @param id [String] The compound ID of the object record, formatted as object_type_id:::object_record_id
|
|
1597
|
+
# @param [Hash] opts the optional parameters
|
|
1598
|
+
# @option opts [Array<String>] :fields_object_record For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1599
|
+
# @return [Hash<String, Object>]
|
|
1600
|
+
def get_object_record(id, opts = {})
|
|
1601
|
+
data, _status_code, _headers = get_object_record_with_http_info(id, opts)
|
|
1602
|
+
data
|
|
1603
|
+
end
|
|
1604
|
+
|
|
1605
|
+
# Get Object Record
|
|
1606
|
+
# Get the object record with the given compound ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_record.json)
|
|
1607
|
+
# @param id [String] The compound ID of the object record, formatted as object_type_id:::object_record_id
|
|
1608
|
+
# @param [Hash] opts the optional parameters
|
|
1609
|
+
# @option opts [Array<String>] :fields_object_record For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1610
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1611
|
+
def get_object_record_with_http_info(id, opts = {})
|
|
1612
|
+
if @api_client.config.debugging
|
|
1613
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_object_record ...'
|
|
1614
|
+
end
|
|
1615
|
+
# verify the required parameter 'id' is set
|
|
1616
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1617
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_object_record"
|
|
1618
|
+
end
|
|
1619
|
+
allowable_values = ["id", "record_properties"]
|
|
1620
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_record'] && !opts[:'fields_object_record'].all? { |item| allowable_values.include?(item) }
|
|
1621
|
+
fail ArgumentError, "invalid value for \"fields_object_record\", must include one of #{allowable_values}"
|
|
1622
|
+
end
|
|
1623
|
+
# resource path
|
|
1624
|
+
local_var_path = '/api/object-records/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1625
|
+
|
|
1626
|
+
# query parameters
|
|
1627
|
+
query_params = opts[:query_params] || {}
|
|
1628
|
+
query_params[:'fields[object-record]'] = @api_client.build_collection_param(opts[:'fields_object_record'], :csv) if !opts[:'fields_object_record'].nil?
|
|
1629
|
+
|
|
1630
|
+
# header parameters
|
|
1631
|
+
header_params = opts[:header_params] || {}
|
|
1632
|
+
# klaviyo api revision
|
|
1633
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1634
|
+
# HTTP header 'Accept' (if needed)
|
|
1635
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1636
|
+
|
|
1637
|
+
# form parameters
|
|
1638
|
+
form_params = opts[:form_params] || {}
|
|
1639
|
+
|
|
1640
|
+
# http body (model)
|
|
1641
|
+
post_body = opts[:debug_body]
|
|
1642
|
+
|
|
1643
|
+
# return_type
|
|
1644
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1645
|
+
|
|
1646
|
+
# auth_names
|
|
1647
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1648
|
+
|
|
1649
|
+
new_options = opts.merge(
|
|
1650
|
+
:operation => :"CustomObjectsApi.get_object_record",
|
|
1651
|
+
:header_params => header_params,
|
|
1652
|
+
:query_params => query_params,
|
|
1653
|
+
:form_params => form_params,
|
|
1654
|
+
:body => post_body,
|
|
1655
|
+
:auth_names => auth_names,
|
|
1656
|
+
:return_type => return_type
|
|
1657
|
+
)
|
|
1658
|
+
|
|
1659
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1660
|
+
if @api_client.config.debugging
|
|
1661
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_object_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1662
|
+
end
|
|
1663
|
+
return data, status_code, headers
|
|
1664
|
+
end
|
|
1665
|
+
|
|
1666
|
+
# Get Object Schema
|
|
1667
|
+
# Get the object schema with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_schema.json)
|
|
1668
|
+
# @param id [String] The ULID ID of the object schema.
|
|
1669
|
+
# @param [Hash] opts the optional parameters
|
|
1670
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1671
|
+
# @option opts [Array<String>] :fields_profile_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1672
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1673
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1674
|
+
# @return [Hash<String, Object>]
|
|
1675
|
+
def get_object_schema(id, opts = {})
|
|
1676
|
+
data, _status_code, _headers = get_object_schema_with_http_info(id, opts)
|
|
1677
|
+
data
|
|
1678
|
+
end
|
|
1679
|
+
|
|
1680
|
+
# Get Object Schema
|
|
1681
|
+
# Get the object schema with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_schema.json)
|
|
1682
|
+
# @param id [String] The ULID ID of the object schema.
|
|
1683
|
+
# @param [Hash] opts the optional parameters
|
|
1684
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1685
|
+
# @option opts [Array<String>] :fields_profile_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1686
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1687
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1688
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1689
|
+
def get_object_schema_with_http_info(id, opts = {})
|
|
1690
|
+
if @api_client.config.debugging
|
|
1691
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_object_schema ...'
|
|
1692
|
+
end
|
|
1693
|
+
# verify the required parameter 'id' is set
|
|
1694
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1695
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_object_schema"
|
|
1696
|
+
end
|
|
1697
|
+
allowable_values = ["description", "id", "meta", "meta.description", "meta.name", "meta.relationship_id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
1698
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
1699
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
1700
|
+
end
|
|
1701
|
+
allowable_values = ["id", "meta", "meta.description", "meta.name", "meta.relationship_id"]
|
|
1702
|
+
if @api_client.config.client_side_validation && opts[:'fields_profile_object_schema'] && !opts[:'fields_profile_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
1703
|
+
fail ArgumentError, "invalid value for \"fields_profile_object_schema\", must include one of #{allowable_values}"
|
|
1704
|
+
end
|
|
1705
|
+
allowable_values = ["id", "property_mappings", "relationship_mappings"]
|
|
1706
|
+
if @api_client.config.client_side_validation && opts[:'fields_source_mapping'] && !opts[:'fields_source_mapping'].all? { |item| allowable_values.include?(item) }
|
|
1707
|
+
fail ArgumentError, "invalid value for \"fields_source_mapping\", must include one of #{allowable_values}"
|
|
1708
|
+
end
|
|
1709
|
+
allowable_values = ["object-schemas", "profile-object-schemas", "source-mapping"]
|
|
1710
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
|
1711
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
|
1712
|
+
end
|
|
1713
|
+
# resource path
|
|
1714
|
+
local_var_path = '/api/object-schemas/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1715
|
+
|
|
1716
|
+
# query parameters
|
|
1717
|
+
query_params = opts[:query_params] || {}
|
|
1718
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
1719
|
+
query_params[:'fields[profile-object-schema]'] = @api_client.build_collection_param(opts[:'fields_profile_object_schema'], :csv) if !opts[:'fields_profile_object_schema'].nil?
|
|
1720
|
+
query_params[:'fields[source-mapping]'] = @api_client.build_collection_param(opts[:'fields_source_mapping'], :csv) if !opts[:'fields_source_mapping'].nil?
|
|
1721
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
|
1722
|
+
|
|
1723
|
+
# header parameters
|
|
1724
|
+
header_params = opts[:header_params] || {}
|
|
1725
|
+
# klaviyo api revision
|
|
1726
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1727
|
+
# HTTP header 'Accept' (if needed)
|
|
1728
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1729
|
+
|
|
1730
|
+
# form parameters
|
|
1731
|
+
form_params = opts[:form_params] || {}
|
|
1732
|
+
|
|
1733
|
+
# http body (model)
|
|
1734
|
+
post_body = opts[:debug_body]
|
|
1735
|
+
|
|
1736
|
+
# return_type
|
|
1737
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1738
|
+
|
|
1739
|
+
# auth_names
|
|
1740
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1741
|
+
|
|
1742
|
+
new_options = opts.merge(
|
|
1743
|
+
:operation => :"CustomObjectsApi.get_object_schema",
|
|
1744
|
+
:header_params => header_params,
|
|
1745
|
+
:query_params => query_params,
|
|
1746
|
+
:form_params => form_params,
|
|
1747
|
+
:body => post_body,
|
|
1748
|
+
:auth_names => auth_names,
|
|
1749
|
+
:return_type => return_type
|
|
1750
|
+
)
|
|
1751
|
+
|
|
1752
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1753
|
+
if @api_client.config.debugging
|
|
1754
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_object_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1755
|
+
end
|
|
1756
|
+
return data, status_code, headers
|
|
1757
|
+
end
|
|
1758
|
+
|
|
1759
|
+
# Get Object Schema Relationships
|
|
1760
|
+
# Get related object schemas for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_schema_relationships.json)
|
|
1761
|
+
# @param id [String] The ULID ID of the object schema.
|
|
1762
|
+
# @param [Hash] opts the optional parameters
|
|
1763
|
+
# @return [Hash<String, Object>]
|
|
1764
|
+
def get_object_schema_relationships(id, opts = {})
|
|
1765
|
+
data, _status_code, _headers = get_object_schema_relationships_with_http_info(id, opts)
|
|
1766
|
+
data
|
|
1767
|
+
end
|
|
1768
|
+
|
|
1769
|
+
# alias of `get_object_schema_relationships`
|
|
1770
|
+
alias get_object_schema_relationships_schemas get_object_schema_relationships
|
|
1771
|
+
|
|
1772
|
+
# alias of `get_object_schema_relationships`
|
|
1773
|
+
alias get_schema_ids_for_object_schema get_object_schema_relationships
|
|
1774
|
+
|
|
1775
|
+
# Get Object Schema Relationships
|
|
1776
|
+
# Get related object schemas for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_schema_relationships.json)
|
|
1777
|
+
# @param id [String] The ULID ID of the object schema.
|
|
1778
|
+
# @param [Hash] opts the optional parameters
|
|
1779
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1780
|
+
def get_object_schema_relationships_with_http_info(id, opts = {})
|
|
1781
|
+
if @api_client.config.debugging
|
|
1782
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_object_schema_relationships ...'
|
|
1783
|
+
end
|
|
1784
|
+
# verify the required parameter 'id' is set
|
|
1785
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1786
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_object_schema_relationships"
|
|
1787
|
+
end
|
|
1788
|
+
# resource path
|
|
1789
|
+
local_var_path = '/api/object-schemas/{id}/relationships/object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1790
|
+
|
|
1791
|
+
# query parameters
|
|
1792
|
+
query_params = opts[:query_params] || {}
|
|
1793
|
+
|
|
1794
|
+
# header parameters
|
|
1795
|
+
header_params = opts[:header_params] || {}
|
|
1796
|
+
# klaviyo api revision
|
|
1797
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1798
|
+
# HTTP header 'Accept' (if needed)
|
|
1799
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1800
|
+
|
|
1801
|
+
# form parameters
|
|
1802
|
+
form_params = opts[:form_params] || {}
|
|
1803
|
+
|
|
1804
|
+
# http body (model)
|
|
1805
|
+
post_body = opts[:debug_body]
|
|
1806
|
+
|
|
1807
|
+
# return_type
|
|
1808
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1809
|
+
|
|
1810
|
+
# auth_names
|
|
1811
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1812
|
+
|
|
1813
|
+
new_options = opts.merge(
|
|
1814
|
+
:operation => :"CustomObjectsApi.get_object_schema_relationships",
|
|
1815
|
+
:header_params => header_params,
|
|
1816
|
+
:query_params => query_params,
|
|
1817
|
+
:form_params => form_params,
|
|
1818
|
+
:body => post_body,
|
|
1819
|
+
:auth_names => auth_names,
|
|
1820
|
+
:return_type => return_type
|
|
1821
|
+
)
|
|
1822
|
+
|
|
1823
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1824
|
+
if @api_client.config.debugging
|
|
1825
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_object_schema_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1826
|
+
end
|
|
1827
|
+
return data, status_code, headers
|
|
1828
|
+
end
|
|
1829
|
+
|
|
1830
|
+
# alias of `get_object_schema_relationships_with_http_info`
|
|
1831
|
+
alias get_object_schema_relationships_schemas_with_http_info get_object_schema_relationships_with_http_info
|
|
1832
|
+
|
|
1833
|
+
# alias of `get_object_schema_relationships_with_http_info`
|
|
1834
|
+
alias get_schema_ids_for_object_schema_with_http_info get_object_schema_relationships_with_http_info
|
|
1835
|
+
|
|
1836
|
+
# Get Object Type
|
|
1837
|
+
# Get the object type with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_type.json)
|
|
1838
|
+
# @param id [String] The ULID ID of the object type.
|
|
1839
|
+
# @param [Hash] opts the optional parameters
|
|
1840
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1841
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1842
|
+
# @option opts [Array<String>] :fields_profile_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1843
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1844
|
+
# @return [Hash<String, Object>]
|
|
1845
|
+
def get_object_type(id, opts = {})
|
|
1846
|
+
data, _status_code, _headers = get_object_type_with_http_info(id, opts)
|
|
1847
|
+
data
|
|
1848
|
+
end
|
|
1849
|
+
|
|
1850
|
+
# Get Object Type
|
|
1851
|
+
# Get the object type with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_type.json)
|
|
1852
|
+
# @param id [String] The ULID ID of the object type.
|
|
1853
|
+
# @param [Hash] opts the optional parameters
|
|
1854
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1855
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1856
|
+
# @option opts [Array<String>] :fields_profile_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1857
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
1858
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1859
|
+
def get_object_type_with_http_info(id, opts = {})
|
|
1860
|
+
if @api_client.config.debugging
|
|
1861
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_object_type ...'
|
|
1862
|
+
end
|
|
1863
|
+
# verify the required parameter 'id' is set
|
|
1864
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1865
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_object_type"
|
|
1866
|
+
end
|
|
1867
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
1868
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
1869
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
1870
|
+
end
|
|
1871
|
+
allowable_values = ["created_at", "description", "id", "meta", "meta.description", "meta.name", "meta.relationship_id", "namespace", "status", "title", "updated_at"]
|
|
1872
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_type'] && !opts[:'fields_object_type'].all? { |item| allowable_values.include?(item) }
|
|
1873
|
+
fail ArgumentError, "invalid value for \"fields_object_type\", must include one of #{allowable_values}"
|
|
1874
|
+
end
|
|
1875
|
+
allowable_values = ["id", "meta", "meta.description", "meta.name", "meta.relationship_id"]
|
|
1876
|
+
if @api_client.config.client_side_validation && opts[:'fields_profile_object_type'] && !opts[:'fields_profile_object_type'].all? { |item| allowable_values.include?(item) }
|
|
1877
|
+
fail ArgumentError, "invalid value for \"fields_profile_object_type\", must include one of #{allowable_values}"
|
|
1878
|
+
end
|
|
1879
|
+
allowable_values = ["current-schema", "draft-schema", "object-types", "profile-object-types", "schema-versions"]
|
|
1880
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
|
1881
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
|
1882
|
+
end
|
|
1883
|
+
# resource path
|
|
1884
|
+
local_var_path = '/api/object-types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1885
|
+
|
|
1886
|
+
# query parameters
|
|
1887
|
+
query_params = opts[:query_params] || {}
|
|
1888
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
1889
|
+
query_params[:'fields[object-type]'] = @api_client.build_collection_param(opts[:'fields_object_type'], :csv) if !opts[:'fields_object_type'].nil?
|
|
1890
|
+
query_params[:'fields[profile-object-type]'] = @api_client.build_collection_param(opts[:'fields_profile_object_type'], :csv) if !opts[:'fields_profile_object_type'].nil?
|
|
1891
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
|
1892
|
+
|
|
1893
|
+
# header parameters
|
|
1894
|
+
header_params = opts[:header_params] || {}
|
|
1895
|
+
# klaviyo api revision
|
|
1896
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1897
|
+
# HTTP header 'Accept' (if needed)
|
|
1898
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1899
|
+
|
|
1900
|
+
# form parameters
|
|
1901
|
+
form_params = opts[:form_params] || {}
|
|
1902
|
+
|
|
1903
|
+
# http body (model)
|
|
1904
|
+
post_body = opts[:debug_body]
|
|
1905
|
+
|
|
1906
|
+
# return_type
|
|
1907
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1908
|
+
|
|
1909
|
+
# auth_names
|
|
1910
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1911
|
+
|
|
1912
|
+
new_options = opts.merge(
|
|
1913
|
+
:operation => :"CustomObjectsApi.get_object_type",
|
|
1914
|
+
:header_params => header_params,
|
|
1915
|
+
:query_params => query_params,
|
|
1916
|
+
:form_params => form_params,
|
|
1917
|
+
:body => post_body,
|
|
1918
|
+
:auth_names => auth_names,
|
|
1919
|
+
:return_type => return_type
|
|
1920
|
+
)
|
|
1921
|
+
|
|
1922
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1923
|
+
if @api_client.config.debugging
|
|
1924
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1925
|
+
end
|
|
1926
|
+
return data, status_code, headers
|
|
1927
|
+
end
|
|
1928
|
+
|
|
1929
|
+
# Get Object Type Relationships
|
|
1930
|
+
# Get related object types for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_type_relationships.json)
|
|
1931
|
+
# @param id [String] The ULID ID of the object type.
|
|
1932
|
+
# @param [Hash] opts the optional parameters
|
|
1933
|
+
# @return [Hash<String, Object>]
|
|
1934
|
+
def get_object_type_relationships(id, opts = {})
|
|
1935
|
+
data, _status_code, _headers = get_object_type_relationships_with_http_info(id, opts)
|
|
1936
|
+
data
|
|
1937
|
+
end
|
|
1938
|
+
|
|
1939
|
+
# alias of `get_object_type_relationships`
|
|
1940
|
+
alias get_object_type_relationships_types get_object_type_relationships
|
|
1941
|
+
|
|
1942
|
+
# alias of `get_object_type_relationships`
|
|
1943
|
+
alias get_type_ids_for_object_type get_object_type_relationships
|
|
1944
|
+
|
|
1945
|
+
# Get Object Type Relationships
|
|
1946
|
+
# Get related object types for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_type_relationships.json)
|
|
1947
|
+
# @param id [String] The ULID ID of the object type.
|
|
1948
|
+
# @param [Hash] opts the optional parameters
|
|
1949
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1950
|
+
def get_object_type_relationships_with_http_info(id, opts = {})
|
|
1951
|
+
if @api_client.config.debugging
|
|
1952
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_object_type_relationships ...'
|
|
1953
|
+
end
|
|
1954
|
+
# verify the required parameter 'id' is set
|
|
1955
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1956
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_object_type_relationships"
|
|
1957
|
+
end
|
|
1958
|
+
# resource path
|
|
1959
|
+
local_var_path = '/api/object-types/{id}/relationships/object-types'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1960
|
+
|
|
1961
|
+
# query parameters
|
|
1962
|
+
query_params = opts[:query_params] || {}
|
|
1963
|
+
|
|
1964
|
+
# header parameters
|
|
1965
|
+
header_params = opts[:header_params] || {}
|
|
1966
|
+
# klaviyo api revision
|
|
1967
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1968
|
+
# HTTP header 'Accept' (if needed)
|
|
1969
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1970
|
+
|
|
1971
|
+
# form parameters
|
|
1972
|
+
form_params = opts[:form_params] || {}
|
|
1973
|
+
|
|
1974
|
+
# http body (model)
|
|
1975
|
+
post_body = opts[:debug_body]
|
|
1976
|
+
|
|
1977
|
+
# return_type
|
|
1978
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
1979
|
+
|
|
1980
|
+
# auth_names
|
|
1981
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
1982
|
+
|
|
1983
|
+
new_options = opts.merge(
|
|
1984
|
+
:operation => :"CustomObjectsApi.get_object_type_relationships",
|
|
1985
|
+
:header_params => header_params,
|
|
1986
|
+
:query_params => query_params,
|
|
1987
|
+
:form_params => form_params,
|
|
1988
|
+
:body => post_body,
|
|
1989
|
+
:auth_names => auth_names,
|
|
1990
|
+
:return_type => return_type
|
|
1991
|
+
)
|
|
1992
|
+
|
|
1993
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1994
|
+
if @api_client.config.debugging
|
|
1995
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_object_type_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1996
|
+
end
|
|
1997
|
+
return data, status_code, headers
|
|
1998
|
+
end
|
|
1999
|
+
|
|
2000
|
+
# alias of `get_object_type_relationships_with_http_info`
|
|
2001
|
+
alias get_object_type_relationships_types_with_http_info get_object_type_relationships_with_http_info
|
|
2002
|
+
|
|
2003
|
+
# alias of `get_object_type_relationships_with_http_info`
|
|
2004
|
+
alias get_type_ids_for_object_type_with_http_info get_object_type_relationships_with_http_info
|
|
2005
|
+
|
|
2006
|
+
# Get Object Types
|
|
2007
|
+
# Get all object types in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_types.json)
|
|
2008
|
+
# @param [Hash] opts the optional parameters
|
|
2009
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2010
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2011
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`namespace`: `equals`
|
|
2012
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
2013
|
+
# @return [Hash<String, Object>]
|
|
2014
|
+
def get_object_types(opts = {})
|
|
2015
|
+
data, _status_code, _headers = get_object_types_with_http_info(opts)
|
|
2016
|
+
data
|
|
2017
|
+
end
|
|
2018
|
+
|
|
2019
|
+
# Get Object Types
|
|
2020
|
+
# Get all object types in an account.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_object_types.json)
|
|
2021
|
+
# @param [Hash] opts the optional parameters
|
|
2022
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2023
|
+
# @option opts [Array<String>] :fields_object_type For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2024
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`namespace`: `equals`
|
|
2025
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
2026
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2027
|
+
def get_object_types_with_http_info(opts = {})
|
|
2028
|
+
if @api_client.config.debugging
|
|
2029
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_object_types ...'
|
|
2030
|
+
end
|
|
2031
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
2032
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
2033
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
2034
|
+
end
|
|
2035
|
+
allowable_values = ["created_at", "description", "id", "namespace", "status", "title", "updated_at"]
|
|
2036
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_type'] && !opts[:'fields_object_type'].all? { |item| allowable_values.include?(item) }
|
|
2037
|
+
fail ArgumentError, "invalid value for \"fields_object_type\", must include one of #{allowable_values}"
|
|
2038
|
+
end
|
|
2039
|
+
allowable_values = ["current-schema", "draft-schema"]
|
|
2040
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
|
2041
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
|
2042
|
+
end
|
|
2043
|
+
# resource path
|
|
2044
|
+
local_var_path = '/api/object-types'
|
|
2045
|
+
|
|
2046
|
+
# query parameters
|
|
2047
|
+
query_params = opts[:query_params] || {}
|
|
2048
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
2049
|
+
query_params[:'fields[object-type]'] = @api_client.build_collection_param(opts[:'fields_object_type'], :csv) if !opts[:'fields_object_type'].nil?
|
|
2050
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
2051
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
|
2052
|
+
|
|
2053
|
+
# header parameters
|
|
2054
|
+
header_params = opts[:header_params] || {}
|
|
2055
|
+
# klaviyo api revision
|
|
2056
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2057
|
+
# HTTP header 'Accept' (if needed)
|
|
2058
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2059
|
+
|
|
2060
|
+
# form parameters
|
|
2061
|
+
form_params = opts[:form_params] || {}
|
|
2062
|
+
|
|
2063
|
+
# http body (model)
|
|
2064
|
+
post_body = opts[:debug_body]
|
|
2065
|
+
|
|
2066
|
+
# return_type
|
|
2067
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2068
|
+
|
|
2069
|
+
# auth_names
|
|
2070
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2071
|
+
|
|
2072
|
+
new_options = opts.merge(
|
|
2073
|
+
:operation => :"CustomObjectsApi.get_object_types",
|
|
2074
|
+
:header_params => header_params,
|
|
2075
|
+
:query_params => query_params,
|
|
2076
|
+
:form_params => form_params,
|
|
2077
|
+
:body => post_body,
|
|
2078
|
+
:auth_names => auth_names,
|
|
2079
|
+
:return_type => return_type
|
|
2080
|
+
)
|
|
2081
|
+
|
|
2082
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2083
|
+
if @api_client.config.debugging
|
|
2084
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_object_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2085
|
+
end
|
|
2086
|
+
return data, status_code, headers
|
|
2087
|
+
end
|
|
2088
|
+
|
|
2089
|
+
# Get Profile Schema Relationships
|
|
2090
|
+
# Get related profile object schemas for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_profile_schema_relationships.json)
|
|
2091
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2092
|
+
# @param [Hash] opts the optional parameters
|
|
2093
|
+
# @return [Hash<String, Object>]
|
|
2094
|
+
def get_profile_schema_relationships(id, opts = {})
|
|
2095
|
+
data, _status_code, _headers = get_profile_schema_relationships_with_http_info(id, opts)
|
|
2096
|
+
data
|
|
2097
|
+
end
|
|
2098
|
+
|
|
2099
|
+
# alias of `get_profile_schema_relationships`
|
|
2100
|
+
alias get_object_schema_relationships_profile_object_schemas get_profile_schema_relationships
|
|
2101
|
+
|
|
2102
|
+
# alias of `get_profile_schema_relationships`
|
|
2103
|
+
alias get_profile_object_schema_ids_for_object_schema get_profile_schema_relationships
|
|
2104
|
+
|
|
2105
|
+
# Get Profile Schema Relationships
|
|
2106
|
+
# Get related profile object schemas for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_profile_schema_relationships.json)
|
|
2107
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2108
|
+
# @param [Hash] opts the optional parameters
|
|
2109
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2110
|
+
def get_profile_schema_relationships_with_http_info(id, opts = {})
|
|
2111
|
+
if @api_client.config.debugging
|
|
2112
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_profile_schema_relationships ...'
|
|
2113
|
+
end
|
|
2114
|
+
# verify the required parameter 'id' is set
|
|
2115
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2116
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_profile_schema_relationships"
|
|
2117
|
+
end
|
|
2118
|
+
# resource path
|
|
2119
|
+
local_var_path = '/api/object-schemas/{id}/relationships/profile-object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2120
|
+
|
|
2121
|
+
# query parameters
|
|
2122
|
+
query_params = opts[:query_params] || {}
|
|
2123
|
+
|
|
2124
|
+
# header parameters
|
|
2125
|
+
header_params = opts[:header_params] || {}
|
|
2126
|
+
# klaviyo api revision
|
|
2127
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2128
|
+
# HTTP header 'Accept' (if needed)
|
|
2129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2130
|
+
|
|
2131
|
+
# form parameters
|
|
2132
|
+
form_params = opts[:form_params] || {}
|
|
2133
|
+
|
|
2134
|
+
# http body (model)
|
|
2135
|
+
post_body = opts[:debug_body]
|
|
2136
|
+
|
|
2137
|
+
# return_type
|
|
2138
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2139
|
+
|
|
2140
|
+
# auth_names
|
|
2141
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2142
|
+
|
|
2143
|
+
new_options = opts.merge(
|
|
2144
|
+
:operation => :"CustomObjectsApi.get_profile_schema_relationships",
|
|
2145
|
+
:header_params => header_params,
|
|
2146
|
+
:query_params => query_params,
|
|
2147
|
+
:form_params => form_params,
|
|
2148
|
+
:body => post_body,
|
|
2149
|
+
:auth_names => auth_names,
|
|
2150
|
+
:return_type => return_type
|
|
2151
|
+
)
|
|
2152
|
+
|
|
2153
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2154
|
+
if @api_client.config.debugging
|
|
2155
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_profile_schema_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2156
|
+
end
|
|
2157
|
+
return data, status_code, headers
|
|
2158
|
+
end
|
|
2159
|
+
|
|
2160
|
+
# alias of `get_profile_schema_relationships_with_http_info`
|
|
2161
|
+
alias get_object_schema_relationships_profile_object_schemas_with_http_info get_profile_schema_relationships_with_http_info
|
|
2162
|
+
|
|
2163
|
+
# alias of `get_profile_schema_relationships_with_http_info`
|
|
2164
|
+
alias get_profile_object_schema_ids_for_object_schema_with_http_info get_profile_schema_relationships_with_http_info
|
|
2165
|
+
|
|
2166
|
+
# Get Profile Type Relationships
|
|
2167
|
+
# Get related profile object types for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_profile_type_relationships.json)
|
|
2168
|
+
# @param id [String] The ULID ID of the object type.
|
|
2169
|
+
# @param [Hash] opts the optional parameters
|
|
2170
|
+
# @return [Hash<String, Object>]
|
|
2171
|
+
def get_profile_type_relationships(id, opts = {})
|
|
2172
|
+
data, _status_code, _headers = get_profile_type_relationships_with_http_info(id, opts)
|
|
2173
|
+
data
|
|
2174
|
+
end
|
|
2175
|
+
|
|
2176
|
+
# alias of `get_profile_type_relationships`
|
|
2177
|
+
alias get_object_type_relationships_profile_object_types get_profile_type_relationships
|
|
2178
|
+
|
|
2179
|
+
# alias of `get_profile_type_relationships`
|
|
2180
|
+
alias get_profile_object_type_ids_for_object_type get_profile_type_relationships
|
|
2181
|
+
|
|
2182
|
+
# Get Profile Type Relationships
|
|
2183
|
+
# Get related profile object types for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_profile_type_relationships.json)
|
|
2184
|
+
# @param id [String] The ULID ID of the object type.
|
|
2185
|
+
# @param [Hash] opts the optional parameters
|
|
2186
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2187
|
+
def get_profile_type_relationships_with_http_info(id, opts = {})
|
|
2188
|
+
if @api_client.config.debugging
|
|
2189
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_profile_type_relationships ...'
|
|
2190
|
+
end
|
|
2191
|
+
# verify the required parameter 'id' is set
|
|
2192
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2193
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_profile_type_relationships"
|
|
2194
|
+
end
|
|
2195
|
+
# resource path
|
|
2196
|
+
local_var_path = '/api/object-types/{id}/relationships/profile-object-types'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2197
|
+
|
|
2198
|
+
# query parameters
|
|
2199
|
+
query_params = opts[:query_params] || {}
|
|
2200
|
+
|
|
2201
|
+
# header parameters
|
|
2202
|
+
header_params = opts[:header_params] || {}
|
|
2203
|
+
# klaviyo api revision
|
|
2204
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2205
|
+
# HTTP header 'Accept' (if needed)
|
|
2206
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2207
|
+
|
|
2208
|
+
# form parameters
|
|
2209
|
+
form_params = opts[:form_params] || {}
|
|
2210
|
+
|
|
2211
|
+
# http body (model)
|
|
2212
|
+
post_body = opts[:debug_body]
|
|
2213
|
+
|
|
2214
|
+
# return_type
|
|
2215
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2216
|
+
|
|
2217
|
+
# auth_names
|
|
2218
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2219
|
+
|
|
2220
|
+
new_options = opts.merge(
|
|
2221
|
+
:operation => :"CustomObjectsApi.get_profile_type_relationships",
|
|
2222
|
+
:header_params => header_params,
|
|
2223
|
+
:query_params => query_params,
|
|
2224
|
+
:form_params => form_params,
|
|
2225
|
+
:body => post_body,
|
|
2226
|
+
:auth_names => auth_names,
|
|
2227
|
+
:return_type => return_type
|
|
2228
|
+
)
|
|
2229
|
+
|
|
2230
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2231
|
+
if @api_client.config.debugging
|
|
2232
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_profile_type_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2233
|
+
end
|
|
2234
|
+
return data, status_code, headers
|
|
2235
|
+
end
|
|
2236
|
+
|
|
2237
|
+
# alias of `get_profile_type_relationships_with_http_info`
|
|
2238
|
+
alias get_object_type_relationships_profile_object_types_with_http_info get_profile_type_relationships_with_http_info
|
|
2239
|
+
|
|
2240
|
+
# alias of `get_profile_type_relationships_with_http_info`
|
|
2241
|
+
alias get_profile_object_type_ids_for_object_type_with_http_info get_profile_type_relationships_with_http_info
|
|
2242
|
+
|
|
2243
|
+
# Get Record IDs for Object Type
|
|
2244
|
+
# Get all object records for a given object type.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_record_ids_for_object_type.json)
|
|
2245
|
+
# @param id [String] The ULID ID of the object type.
|
|
2246
|
+
# @param [Hash] opts the optional parameters
|
|
2247
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
2248
|
+
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
2249
|
+
# @return [Hash<String, Object>]
|
|
2250
|
+
def get_record_ids_for_object_type(id, opts = {})
|
|
2251
|
+
data, _status_code, _headers = get_record_ids_for_object_type_with_http_info(id, opts)
|
|
2252
|
+
data
|
|
2253
|
+
end
|
|
2254
|
+
|
|
2255
|
+
# alias of `get_record_ids_for_object_type`
|
|
2256
|
+
alias get_object_type_relationships_records get_record_ids_for_object_type
|
|
2257
|
+
|
|
2258
|
+
# Get Record IDs for Object Type
|
|
2259
|
+
# Get all object records for a given object type.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_record_ids_for_object_type.json)
|
|
2260
|
+
# @param id [String] The ULID ID of the object type.
|
|
2261
|
+
# @param [Hash] opts the optional parameters
|
|
2262
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
2263
|
+
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
2264
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2265
|
+
def get_record_ids_for_object_type_with_http_info(id, opts = {})
|
|
2266
|
+
if @api_client.config.debugging
|
|
2267
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_record_ids_for_object_type ...'
|
|
2268
|
+
end
|
|
2269
|
+
# verify the required parameter 'id' is set
|
|
2270
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2271
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_record_ids_for_object_type"
|
|
2272
|
+
end
|
|
2273
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
2274
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomObjectsApi.get_record_ids_for_object_type, must be smaller than or equal to 100.'
|
|
2275
|
+
end
|
|
2276
|
+
|
|
2277
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
2278
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomObjectsApi.get_record_ids_for_object_type, must be greater than or equal to 1.'
|
|
2279
|
+
end
|
|
2280
|
+
|
|
2281
|
+
# resource path
|
|
2282
|
+
local_var_path = '/api/object-types/{id}/relationships/object-records'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2283
|
+
|
|
2284
|
+
# query parameters
|
|
2285
|
+
query_params = opts[:query_params] || {}
|
|
2286
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
2287
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
2288
|
+
|
|
2289
|
+
# header parameters
|
|
2290
|
+
header_params = opts[:header_params] || {}
|
|
2291
|
+
# klaviyo api revision
|
|
2292
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2293
|
+
# HTTP header 'Accept' (if needed)
|
|
2294
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2295
|
+
|
|
2296
|
+
# form parameters
|
|
2297
|
+
form_params = opts[:form_params] || {}
|
|
2298
|
+
|
|
2299
|
+
# http body (model)
|
|
2300
|
+
post_body = opts[:debug_body]
|
|
2301
|
+
|
|
2302
|
+
# return_type
|
|
2303
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2304
|
+
|
|
2305
|
+
# auth_names
|
|
2306
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2307
|
+
|
|
2308
|
+
new_options = opts.merge(
|
|
2309
|
+
:operation => :"CustomObjectsApi.get_record_ids_for_object_type",
|
|
2310
|
+
:header_params => header_params,
|
|
2311
|
+
:query_params => query_params,
|
|
2312
|
+
:form_params => form_params,
|
|
2313
|
+
:body => post_body,
|
|
2314
|
+
:auth_names => auth_names,
|
|
2315
|
+
:return_type => return_type
|
|
2316
|
+
)
|
|
2317
|
+
|
|
2318
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2319
|
+
if @api_client.config.debugging
|
|
2320
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_record_ids_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2321
|
+
end
|
|
2322
|
+
return data, status_code, headers
|
|
2323
|
+
end
|
|
2324
|
+
|
|
2325
|
+
# alias of `get_record_ids_for_object_type_with_http_info`
|
|
2326
|
+
alias get_object_type_relationships_records_with_http_info get_record_ids_for_object_type_with_http_info
|
|
2327
|
+
|
|
2328
|
+
# Get Records for Object Type
|
|
2329
|
+
# Get all object records for a given object type.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_records_for_object_type.json)
|
|
2330
|
+
# @param id [String] The ULID ID of the object type.
|
|
2331
|
+
# @param [Hash] opts the optional parameters
|
|
2332
|
+
# @option opts [Array<String>] :fields_object_record For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2333
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
2334
|
+
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
2335
|
+
# @return [Hash<String, Object>]
|
|
2336
|
+
def get_records_for_object_type(id, opts = {})
|
|
2337
|
+
data, _status_code, _headers = get_records_for_object_type_with_http_info(id, opts)
|
|
2338
|
+
data
|
|
2339
|
+
end
|
|
2340
|
+
|
|
2341
|
+
# alias of `get_records_for_object_type`
|
|
2342
|
+
alias get_object_type_records get_records_for_object_type
|
|
2343
|
+
|
|
2344
|
+
# Get Records for Object Type
|
|
2345
|
+
# Get all object records for a given object type.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_records_for_object_type.json)
|
|
2346
|
+
# @param id [String] The ULID ID of the object type.
|
|
2347
|
+
# @param [Hash] opts the optional parameters
|
|
2348
|
+
# @option opts [Array<String>] :fields_object_record For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2349
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
2350
|
+
# @option opts [Integer] :page_size Default: 20. Min: 1. Max: 100. (default to 20)
|
|
2351
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2352
|
+
def get_records_for_object_type_with_http_info(id, opts = {})
|
|
2353
|
+
if @api_client.config.debugging
|
|
2354
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_records_for_object_type ...'
|
|
2355
|
+
end
|
|
2356
|
+
# verify the required parameter 'id' is set
|
|
2357
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2358
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_records_for_object_type"
|
|
2359
|
+
end
|
|
2360
|
+
allowable_values = ["id", "record_properties"]
|
|
2361
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_record'] && !opts[:'fields_object_record'].all? { |item| allowable_values.include?(item) }
|
|
2362
|
+
fail ArgumentError, "invalid value for \"fields_object_record\", must include one of #{allowable_values}"
|
|
2363
|
+
end
|
|
2364
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
2365
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomObjectsApi.get_records_for_object_type, must be smaller than or equal to 100.'
|
|
2366
|
+
end
|
|
2367
|
+
|
|
2368
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
2369
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomObjectsApi.get_records_for_object_type, must be greater than or equal to 1.'
|
|
2370
|
+
end
|
|
2371
|
+
|
|
2372
|
+
# resource path
|
|
2373
|
+
local_var_path = '/api/object-types/{id}/object-records'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2374
|
+
|
|
2375
|
+
# query parameters
|
|
2376
|
+
query_params = opts[:query_params] || {}
|
|
2377
|
+
query_params[:'fields[object-record]'] = @api_client.build_collection_param(opts[:'fields_object_record'], :csv) if !opts[:'fields_object_record'].nil?
|
|
2378
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
2379
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
2380
|
+
|
|
2381
|
+
# header parameters
|
|
2382
|
+
header_params = opts[:header_params] || {}
|
|
2383
|
+
# klaviyo api revision
|
|
2384
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2385
|
+
# HTTP header 'Accept' (if needed)
|
|
2386
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2387
|
+
|
|
2388
|
+
# form parameters
|
|
2389
|
+
form_params = opts[:form_params] || {}
|
|
2390
|
+
|
|
2391
|
+
# http body (model)
|
|
2392
|
+
post_body = opts[:debug_body]
|
|
2393
|
+
|
|
2394
|
+
# return_type
|
|
2395
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2396
|
+
|
|
2397
|
+
# auth_names
|
|
2398
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2399
|
+
|
|
2400
|
+
new_options = opts.merge(
|
|
2401
|
+
:operation => :"CustomObjectsApi.get_records_for_object_type",
|
|
2402
|
+
:header_params => header_params,
|
|
2403
|
+
:query_params => query_params,
|
|
2404
|
+
:form_params => form_params,
|
|
2405
|
+
:body => post_body,
|
|
2406
|
+
:auth_names => auth_names,
|
|
2407
|
+
:return_type => return_type
|
|
2408
|
+
)
|
|
2409
|
+
|
|
2410
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2411
|
+
if @api_client.config.debugging
|
|
2412
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_records_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2413
|
+
end
|
|
2414
|
+
return data, status_code, headers
|
|
2415
|
+
end
|
|
2416
|
+
|
|
2417
|
+
# alias of `get_records_for_object_type_with_http_info`
|
|
2418
|
+
alias get_object_type_records_with_http_info get_records_for_object_type_with_http_info
|
|
2419
|
+
|
|
2420
|
+
# Get Schema Version IDs for Object Type
|
|
2421
|
+
# Get all schema versions for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_schema_version_ids_for_object_type.json)
|
|
2422
|
+
# @param id [String] The ULID ID of the object type.
|
|
2423
|
+
# @param [Hash] opts the optional parameters
|
|
2424
|
+
# @return [Hash<String, Object>]
|
|
2425
|
+
def get_schema_version_ids_for_object_type(id, opts = {})
|
|
2426
|
+
data, _status_code, _headers = get_schema_version_ids_for_object_type_with_http_info(id, opts)
|
|
2427
|
+
data
|
|
2428
|
+
end
|
|
2429
|
+
|
|
2430
|
+
# alias of `get_schema_version_ids_for_object_type`
|
|
2431
|
+
alias get_object_type_relationships_schema_versions get_schema_version_ids_for_object_type
|
|
2432
|
+
|
|
2433
|
+
# Get Schema Version IDs for Object Type
|
|
2434
|
+
# Get all schema versions for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_schema_version_ids_for_object_type.json)
|
|
2435
|
+
# @param id [String] The ULID ID of the object type.
|
|
2436
|
+
# @param [Hash] opts the optional parameters
|
|
2437
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2438
|
+
def get_schema_version_ids_for_object_type_with_http_info(id, opts = {})
|
|
2439
|
+
if @api_client.config.debugging
|
|
2440
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_schema_version_ids_for_object_type ...'
|
|
2441
|
+
end
|
|
2442
|
+
# verify the required parameter 'id' is set
|
|
2443
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2444
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_schema_version_ids_for_object_type"
|
|
2445
|
+
end
|
|
2446
|
+
# resource path
|
|
2447
|
+
local_var_path = '/api/object-types/{id}/relationships/schema-versions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2448
|
+
|
|
2449
|
+
# query parameters
|
|
2450
|
+
query_params = opts[:query_params] || {}
|
|
2451
|
+
|
|
2452
|
+
# header parameters
|
|
2453
|
+
header_params = opts[:header_params] || {}
|
|
2454
|
+
# klaviyo api revision
|
|
2455
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2456
|
+
# HTTP header 'Accept' (if needed)
|
|
2457
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2458
|
+
|
|
2459
|
+
# form parameters
|
|
2460
|
+
form_params = opts[:form_params] || {}
|
|
2461
|
+
|
|
2462
|
+
# http body (model)
|
|
2463
|
+
post_body = opts[:debug_body]
|
|
2464
|
+
|
|
2465
|
+
# return_type
|
|
2466
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2467
|
+
|
|
2468
|
+
# auth_names
|
|
2469
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2470
|
+
|
|
2471
|
+
new_options = opts.merge(
|
|
2472
|
+
:operation => :"CustomObjectsApi.get_schema_version_ids_for_object_type",
|
|
2473
|
+
:header_params => header_params,
|
|
2474
|
+
:query_params => query_params,
|
|
2475
|
+
:form_params => form_params,
|
|
2476
|
+
:body => post_body,
|
|
2477
|
+
:auth_names => auth_names,
|
|
2478
|
+
:return_type => return_type
|
|
2479
|
+
)
|
|
2480
|
+
|
|
2481
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2482
|
+
if @api_client.config.debugging
|
|
2483
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_schema_version_ids_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2484
|
+
end
|
|
2485
|
+
return data, status_code, headers
|
|
2486
|
+
end
|
|
2487
|
+
|
|
2488
|
+
# alias of `get_schema_version_ids_for_object_type_with_http_info`
|
|
2489
|
+
alias get_object_type_relationships_schema_versions_with_http_info get_schema_version_ids_for_object_type_with_http_info
|
|
2490
|
+
|
|
2491
|
+
# Get Schema Versions for Object Type
|
|
2492
|
+
# Get all schema versions for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_schema_versions_for_object_type.json)
|
|
2493
|
+
# @param id [String] The ULID ID of the object type.
|
|
2494
|
+
# @param [Hash] opts the optional parameters
|
|
2495
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2496
|
+
# @return [Hash<String, Object>]
|
|
2497
|
+
def get_schema_versions_for_object_type(id, opts = {})
|
|
2498
|
+
data, _status_code, _headers = get_schema_versions_for_object_type_with_http_info(id, opts)
|
|
2499
|
+
data
|
|
2500
|
+
end
|
|
2501
|
+
|
|
2502
|
+
# alias of `get_schema_versions_for_object_type`
|
|
2503
|
+
alias get_object_type_schema_versions get_schema_versions_for_object_type
|
|
2504
|
+
|
|
2505
|
+
# Get Schema Versions for Object Type
|
|
2506
|
+
# Get all schema versions for an object type<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_schema_versions_for_object_type.json)
|
|
2507
|
+
# @param id [String] The ULID ID of the object type.
|
|
2508
|
+
# @param [Hash] opts the optional parameters
|
|
2509
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2510
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2511
|
+
def get_schema_versions_for_object_type_with_http_info(id, opts = {})
|
|
2512
|
+
if @api_client.config.debugging
|
|
2513
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_schema_versions_for_object_type ...'
|
|
2514
|
+
end
|
|
2515
|
+
# verify the required parameter 'id' is set
|
|
2516
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2517
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_schema_versions_for_object_type"
|
|
2518
|
+
end
|
|
2519
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
2520
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
2521
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
2522
|
+
end
|
|
2523
|
+
# resource path
|
|
2524
|
+
local_var_path = '/api/object-types/{id}/schema-versions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2525
|
+
|
|
2526
|
+
# query parameters
|
|
2527
|
+
query_params = opts[:query_params] || {}
|
|
2528
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
2529
|
+
|
|
2530
|
+
# header parameters
|
|
2531
|
+
header_params = opts[:header_params] || {}
|
|
2532
|
+
# klaviyo api revision
|
|
2533
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2534
|
+
# HTTP header 'Accept' (if needed)
|
|
2535
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2536
|
+
|
|
2537
|
+
# form parameters
|
|
2538
|
+
form_params = opts[:form_params] || {}
|
|
2539
|
+
|
|
2540
|
+
# http body (model)
|
|
2541
|
+
post_body = opts[:debug_body]
|
|
2542
|
+
|
|
2543
|
+
# return_type
|
|
2544
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2545
|
+
|
|
2546
|
+
# auth_names
|
|
2547
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2548
|
+
|
|
2549
|
+
new_options = opts.merge(
|
|
2550
|
+
:operation => :"CustomObjectsApi.get_schema_versions_for_object_type",
|
|
2551
|
+
:header_params => header_params,
|
|
2552
|
+
:query_params => query_params,
|
|
2553
|
+
:form_params => form_params,
|
|
2554
|
+
:body => post_body,
|
|
2555
|
+
:auth_names => auth_names,
|
|
2556
|
+
:return_type => return_type
|
|
2557
|
+
)
|
|
2558
|
+
|
|
2559
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2560
|
+
if @api_client.config.debugging
|
|
2561
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_schema_versions_for_object_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2562
|
+
end
|
|
2563
|
+
return data, status_code, headers
|
|
2564
|
+
end
|
|
2565
|
+
|
|
2566
|
+
# alias of `get_schema_versions_for_object_type_with_http_info`
|
|
2567
|
+
alias get_object_type_schema_versions_with_http_info get_schema_versions_for_object_type_with_http_info
|
|
2568
|
+
|
|
2569
|
+
# Get Source Mapping
|
|
2570
|
+
# Get the source mapping with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_source_mapping.json)
|
|
2571
|
+
# @param id [String] The ID of the source mapping
|
|
2572
|
+
# @param [Hash] opts the optional parameters
|
|
2573
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2574
|
+
# @return [Hash<String, Object>]
|
|
2575
|
+
def get_source_mapping(id, opts = {})
|
|
2576
|
+
data, _status_code, _headers = get_source_mapping_with_http_info(id, opts)
|
|
2577
|
+
data
|
|
2578
|
+
end
|
|
2579
|
+
|
|
2580
|
+
# Get Source Mapping
|
|
2581
|
+
# Get the source mapping with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_source_mapping.json)
|
|
2582
|
+
# @param id [String] The ID of the source mapping
|
|
2583
|
+
# @param [Hash] opts the optional parameters
|
|
2584
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2585
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2586
|
+
def get_source_mapping_with_http_info(id, opts = {})
|
|
2587
|
+
if @api_client.config.debugging
|
|
2588
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_source_mapping ...'
|
|
2589
|
+
end
|
|
2590
|
+
# verify the required parameter 'id' is set
|
|
2591
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2592
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_source_mapping"
|
|
2593
|
+
end
|
|
2594
|
+
allowable_values = ["id", "property_mappings", "relationship_mappings"]
|
|
2595
|
+
if @api_client.config.client_side_validation && opts[:'fields_source_mapping'] && !opts[:'fields_source_mapping'].all? { |item| allowable_values.include?(item) }
|
|
2596
|
+
fail ArgumentError, "invalid value for \"fields_source_mapping\", must include one of #{allowable_values}"
|
|
2597
|
+
end
|
|
2598
|
+
# resource path
|
|
2599
|
+
local_var_path = '/api/source-mappings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2600
|
+
|
|
2601
|
+
# query parameters
|
|
2602
|
+
query_params = opts[:query_params] || {}
|
|
2603
|
+
query_params[:'fields[source-mapping]'] = @api_client.build_collection_param(opts[:'fields_source_mapping'], :csv) if !opts[:'fields_source_mapping'].nil?
|
|
2604
|
+
|
|
2605
|
+
# header parameters
|
|
2606
|
+
header_params = opts[:header_params] || {}
|
|
2607
|
+
# klaviyo api revision
|
|
2608
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2609
|
+
# HTTP header 'Accept' (if needed)
|
|
2610
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2611
|
+
|
|
2612
|
+
# form parameters
|
|
2613
|
+
form_params = opts[:form_params] || {}
|
|
2614
|
+
|
|
2615
|
+
# http body (model)
|
|
2616
|
+
post_body = opts[:debug_body]
|
|
2617
|
+
|
|
2618
|
+
# return_type
|
|
2619
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2620
|
+
|
|
2621
|
+
# auth_names
|
|
2622
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2623
|
+
|
|
2624
|
+
new_options = opts.merge(
|
|
2625
|
+
:operation => :"CustomObjectsApi.get_source_mapping",
|
|
2626
|
+
:header_params => header_params,
|
|
2627
|
+
:query_params => query_params,
|
|
2628
|
+
:form_params => form_params,
|
|
2629
|
+
:body => post_body,
|
|
2630
|
+
:auth_names => auth_names,
|
|
2631
|
+
:return_type => return_type
|
|
2632
|
+
)
|
|
2633
|
+
|
|
2634
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2635
|
+
if @api_client.config.debugging
|
|
2636
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_source_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2637
|
+
end
|
|
2638
|
+
return data, status_code, headers
|
|
2639
|
+
end
|
|
2640
|
+
|
|
2641
|
+
# Get Source Mapping for Object Schema
|
|
2642
|
+
# Get source mapping for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_source_mapping_for_object_schema.json)
|
|
2643
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2644
|
+
# @param [Hash] opts the optional parameters
|
|
2645
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2646
|
+
# @return [Hash<String, Object>]
|
|
2647
|
+
def get_source_mapping_for_object_schema(id, opts = {})
|
|
2648
|
+
data, _status_code, _headers = get_source_mapping_for_object_schema_with_http_info(id, opts)
|
|
2649
|
+
data
|
|
2650
|
+
end
|
|
2651
|
+
|
|
2652
|
+
# alias of `get_source_mapping_for_object_schema`
|
|
2653
|
+
alias get_object_schema_source_mapping get_source_mapping_for_object_schema
|
|
2654
|
+
|
|
2655
|
+
# Get Source Mapping for Object Schema
|
|
2656
|
+
# Get source mapping for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_source_mapping_for_object_schema.json)
|
|
2657
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2658
|
+
# @param [Hash] opts the optional parameters
|
|
2659
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2660
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2661
|
+
def get_source_mapping_for_object_schema_with_http_info(id, opts = {})
|
|
2662
|
+
if @api_client.config.debugging
|
|
2663
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_source_mapping_for_object_schema ...'
|
|
2664
|
+
end
|
|
2665
|
+
# verify the required parameter 'id' is set
|
|
2666
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2667
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_source_mapping_for_object_schema"
|
|
2668
|
+
end
|
|
2669
|
+
allowable_values = ["id", "property_mappings", "relationship_mappings"]
|
|
2670
|
+
if @api_client.config.client_side_validation && opts[:'fields_source_mapping'] && !opts[:'fields_source_mapping'].all? { |item| allowable_values.include?(item) }
|
|
2671
|
+
fail ArgumentError, "invalid value for \"fields_source_mapping\", must include one of #{allowable_values}"
|
|
2672
|
+
end
|
|
2673
|
+
# resource path
|
|
2674
|
+
local_var_path = '/api/object-schemas/{id}/source-mapping'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2675
|
+
|
|
2676
|
+
# query parameters
|
|
2677
|
+
query_params = opts[:query_params] || {}
|
|
2678
|
+
query_params[:'fields[source-mapping]'] = @api_client.build_collection_param(opts[:'fields_source_mapping'], :csv) if !opts[:'fields_source_mapping'].nil?
|
|
2679
|
+
|
|
2680
|
+
# header parameters
|
|
2681
|
+
header_params = opts[:header_params] || {}
|
|
2682
|
+
# klaviyo api revision
|
|
2683
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2684
|
+
# HTTP header 'Accept' (if needed)
|
|
2685
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2686
|
+
|
|
2687
|
+
# form parameters
|
|
2688
|
+
form_params = opts[:form_params] || {}
|
|
2689
|
+
|
|
2690
|
+
# http body (model)
|
|
2691
|
+
post_body = opts[:debug_body]
|
|
2692
|
+
|
|
2693
|
+
# return_type
|
|
2694
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2695
|
+
|
|
2696
|
+
# auth_names
|
|
2697
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2698
|
+
|
|
2699
|
+
new_options = opts.merge(
|
|
2700
|
+
:operation => :"CustomObjectsApi.get_source_mapping_for_object_schema",
|
|
2701
|
+
:header_params => header_params,
|
|
2702
|
+
:query_params => query_params,
|
|
2703
|
+
:form_params => form_params,
|
|
2704
|
+
:body => post_body,
|
|
2705
|
+
:auth_names => auth_names,
|
|
2706
|
+
:return_type => return_type
|
|
2707
|
+
)
|
|
2708
|
+
|
|
2709
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2710
|
+
if @api_client.config.debugging
|
|
2711
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_source_mapping_for_object_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2712
|
+
end
|
|
2713
|
+
return data, status_code, headers
|
|
2714
|
+
end
|
|
2715
|
+
|
|
2716
|
+
# alias of `get_source_mapping_for_object_schema_with_http_info`
|
|
2717
|
+
alias get_object_schema_source_mapping_with_http_info get_source_mapping_for_object_schema_with_http_info
|
|
2718
|
+
|
|
2719
|
+
# Get Source Mapping ID for Object Schema
|
|
2720
|
+
# Get source mapping for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_source_mapping_id_for_object_schema.json)
|
|
2721
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2722
|
+
# @param [Hash] opts the optional parameters
|
|
2723
|
+
# @return [Hash<String, Object>]
|
|
2724
|
+
def get_source_mapping_id_for_object_schema(id, opts = {})
|
|
2725
|
+
data, _status_code, _headers = get_source_mapping_id_for_object_schema_with_http_info(id, opts)
|
|
2726
|
+
data
|
|
2727
|
+
end
|
|
2728
|
+
|
|
2729
|
+
# alias of `get_source_mapping_id_for_object_schema`
|
|
2730
|
+
alias get_object_schema_relationships_source_mapping get_source_mapping_id_for_object_schema
|
|
2731
|
+
|
|
2732
|
+
# Get Source Mapping ID for Object Schema
|
|
2733
|
+
# Get source mapping for an object schema<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_source_mapping_id_for_object_schema.json)
|
|
2734
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2735
|
+
# @param [Hash] opts the optional parameters
|
|
2736
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2737
|
+
def get_source_mapping_id_for_object_schema_with_http_info(id, opts = {})
|
|
2738
|
+
if @api_client.config.debugging
|
|
2739
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.get_source_mapping_id_for_object_schema ...'
|
|
2740
|
+
end
|
|
2741
|
+
# verify the required parameter 'id' is set
|
|
2742
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2743
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.get_source_mapping_id_for_object_schema"
|
|
2744
|
+
end
|
|
2745
|
+
# resource path
|
|
2746
|
+
local_var_path = '/api/object-schemas/{id}/relationships/source-mapping'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2747
|
+
|
|
2748
|
+
# query parameters
|
|
2749
|
+
query_params = opts[:query_params] || {}
|
|
2750
|
+
|
|
2751
|
+
# header parameters
|
|
2752
|
+
header_params = opts[:header_params] || {}
|
|
2753
|
+
# klaviyo api revision
|
|
2754
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2755
|
+
# HTTP header 'Accept' (if needed)
|
|
2756
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2757
|
+
|
|
2758
|
+
# form parameters
|
|
2759
|
+
form_params = opts[:form_params] || {}
|
|
2760
|
+
|
|
2761
|
+
# http body (model)
|
|
2762
|
+
post_body = opts[:debug_body]
|
|
2763
|
+
|
|
2764
|
+
# return_type
|
|
2765
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2766
|
+
|
|
2767
|
+
# auth_names
|
|
2768
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2769
|
+
|
|
2770
|
+
new_options = opts.merge(
|
|
2771
|
+
:operation => :"CustomObjectsApi.get_source_mapping_id_for_object_schema",
|
|
445
2772
|
:header_params => header_params,
|
|
446
2773
|
:query_params => query_params,
|
|
447
2774
|
:form_params => form_params,
|
|
@@ -452,7 +2779,352 @@ module KlaviyoAPI
|
|
|
452
2779
|
|
|
453
2780
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
454
2781
|
if @api_client.config.debugging
|
|
455
|
-
@api_client.config.logger.debug "API called: CustomObjectsApi#
|
|
2782
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#get_source_mapping_id_for_object_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2783
|
+
end
|
|
2784
|
+
return data, status_code, headers
|
|
2785
|
+
end
|
|
2786
|
+
|
|
2787
|
+
# alias of `get_source_mapping_id_for_object_schema_with_http_info`
|
|
2788
|
+
alias get_object_schema_relationships_source_mapping_with_http_info get_source_mapping_id_for_object_schema_with_http_info
|
|
2789
|
+
|
|
2790
|
+
# Update Object Schema
|
|
2791
|
+
# Update the object schema with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_object_schema.json)
|
|
2792
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2793
|
+
# @param object_schema_partial_update_query [ObjectSchemaPartialUpdateQuery] Update a object schema by ID
|
|
2794
|
+
# @param [Hash] opts the optional parameters
|
|
2795
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2796
|
+
# @return [Hash<String, Object>]
|
|
2797
|
+
def update_object_schema(id, object_schema_partial_update_query, opts = {})
|
|
2798
|
+
data, _status_code, _headers = update_object_schema_with_http_info(id, object_schema_partial_update_query, opts)
|
|
2799
|
+
data
|
|
2800
|
+
end
|
|
2801
|
+
|
|
2802
|
+
# Update Object Schema
|
|
2803
|
+
# Update the object schema with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_object_schema.json)
|
|
2804
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2805
|
+
# @param object_schema_partial_update_query [ObjectSchemaPartialUpdateQuery] Update a object schema by ID
|
|
2806
|
+
# @param [Hash] opts the optional parameters
|
|
2807
|
+
# @option opts [Array<String>] :fields_object_schema For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
2808
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
2809
|
+
def update_object_schema_with_http_info(id, object_schema_partial_update_query, opts = {})
|
|
2810
|
+
if @api_client.config.debugging
|
|
2811
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.update_object_schema ...'
|
|
2812
|
+
end
|
|
2813
|
+
# verify the required parameter 'id' is set
|
|
2814
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2815
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.update_object_schema"
|
|
2816
|
+
end
|
|
2817
|
+
# verify the required parameter 'object_schema_partial_update_query' is set
|
|
2818
|
+
if @api_client.config.client_side_validation && object_schema_partial_update_query.nil?
|
|
2819
|
+
fail ArgumentError, "Missing the required parameter 'object_schema_partial_update_query' when calling CustomObjectsApi.update_object_schema"
|
|
2820
|
+
end
|
|
2821
|
+
allowable_values = ["description", "id", "properties", "published_at", "required", "status", "title", "visibility"]
|
|
2822
|
+
if @api_client.config.client_side_validation && opts[:'fields_object_schema'] && !opts[:'fields_object_schema'].all? { |item| allowable_values.include?(item) }
|
|
2823
|
+
fail ArgumentError, "invalid value for \"fields_object_schema\", must include one of #{allowable_values}"
|
|
2824
|
+
end
|
|
2825
|
+
# resource path
|
|
2826
|
+
local_var_path = '/api/object-schemas/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2827
|
+
|
|
2828
|
+
# query parameters
|
|
2829
|
+
query_params = opts[:query_params] || {}
|
|
2830
|
+
query_params[:'fields[object-schema]'] = @api_client.build_collection_param(opts[:'fields_object_schema'], :csv) if !opts[:'fields_object_schema'].nil?
|
|
2831
|
+
|
|
2832
|
+
# header parameters
|
|
2833
|
+
header_params = opts[:header_params] || {}
|
|
2834
|
+
# klaviyo api revision
|
|
2835
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2836
|
+
# HTTP header 'Accept' (if needed)
|
|
2837
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2838
|
+
# HTTP header 'Content-Type'
|
|
2839
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
2840
|
+
if !content_type.nil?
|
|
2841
|
+
header_params['Content-Type'] = content_type
|
|
2842
|
+
end
|
|
2843
|
+
|
|
2844
|
+
# form parameters
|
|
2845
|
+
form_params = opts[:form_params] || {}
|
|
2846
|
+
|
|
2847
|
+
# http body (model)
|
|
2848
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_schema_partial_update_query)
|
|
2849
|
+
|
|
2850
|
+
# return_type
|
|
2851
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
2852
|
+
|
|
2853
|
+
# auth_names
|
|
2854
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2855
|
+
|
|
2856
|
+
new_options = opts.merge(
|
|
2857
|
+
:operation => :"CustomObjectsApi.update_object_schema",
|
|
2858
|
+
:header_params => header_params,
|
|
2859
|
+
:query_params => query_params,
|
|
2860
|
+
:form_params => form_params,
|
|
2861
|
+
:body => post_body,
|
|
2862
|
+
:auth_names => auth_names,
|
|
2863
|
+
:return_type => return_type
|
|
2864
|
+
)
|
|
2865
|
+
|
|
2866
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
2867
|
+
if @api_client.config.debugging
|
|
2868
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#update_object_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2869
|
+
end
|
|
2870
|
+
return data, status_code, headers
|
|
2871
|
+
end
|
|
2872
|
+
|
|
2873
|
+
# Update Object Schema Relationship
|
|
2874
|
+
# Update a relationship between object schemas<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_object_schema_relationship.json)
|
|
2875
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2876
|
+
# @param object_schema_relationship_partial_update_query [ObjectSchemaRelationshipPartialUpdateQuery] Update a relationship between object schemas
|
|
2877
|
+
# @param [Hash] opts the optional parameters
|
|
2878
|
+
# @return [nil]
|
|
2879
|
+
def update_object_schema_relationship(id, object_schema_relationship_partial_update_query, opts = {})
|
|
2880
|
+
update_object_schema_relationship_with_http_info(id, object_schema_relationship_partial_update_query, opts)
|
|
2881
|
+
nil
|
|
2882
|
+
end
|
|
2883
|
+
|
|
2884
|
+
# alias of `update_object_schema_relationship`
|
|
2885
|
+
alias update_object_schema_relationships_schemas update_object_schema_relationship
|
|
2886
|
+
|
|
2887
|
+
# alias of `update_object_schema_relationship`
|
|
2888
|
+
alias update_schemas_for_object_schema update_object_schema_relationship
|
|
2889
|
+
|
|
2890
|
+
# Update Object Schema Relationship
|
|
2891
|
+
# Update a relationship between object schemas<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_object_schema_relationship.json)
|
|
2892
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2893
|
+
# @param object_schema_relationship_partial_update_query [ObjectSchemaRelationshipPartialUpdateQuery] Update a relationship between object schemas
|
|
2894
|
+
# @param [Hash] opts the optional parameters
|
|
2895
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
2896
|
+
def update_object_schema_relationship_with_http_info(id, object_schema_relationship_partial_update_query, opts = {})
|
|
2897
|
+
if @api_client.config.debugging
|
|
2898
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.update_object_schema_relationship ...'
|
|
2899
|
+
end
|
|
2900
|
+
# verify the required parameter 'id' is set
|
|
2901
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2902
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.update_object_schema_relationship"
|
|
2903
|
+
end
|
|
2904
|
+
# verify the required parameter 'object_schema_relationship_partial_update_query' is set
|
|
2905
|
+
if @api_client.config.client_side_validation && object_schema_relationship_partial_update_query.nil?
|
|
2906
|
+
fail ArgumentError, "Missing the required parameter 'object_schema_relationship_partial_update_query' when calling CustomObjectsApi.update_object_schema_relationship"
|
|
2907
|
+
end
|
|
2908
|
+
# resource path
|
|
2909
|
+
local_var_path = '/api/object-schemas/{id}/relationships/object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2910
|
+
|
|
2911
|
+
# query parameters
|
|
2912
|
+
query_params = opts[:query_params] || {}
|
|
2913
|
+
|
|
2914
|
+
# header parameters
|
|
2915
|
+
header_params = opts[:header_params] || {}
|
|
2916
|
+
# klaviyo api revision
|
|
2917
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
2918
|
+
# HTTP header 'Accept' (if needed)
|
|
2919
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
2920
|
+
# HTTP header 'Content-Type'
|
|
2921
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
2922
|
+
if !content_type.nil?
|
|
2923
|
+
header_params['Content-Type'] = content_type
|
|
2924
|
+
end
|
|
2925
|
+
|
|
2926
|
+
# form parameters
|
|
2927
|
+
form_params = opts[:form_params] || {}
|
|
2928
|
+
|
|
2929
|
+
# http body (model)
|
|
2930
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(object_schema_relationship_partial_update_query)
|
|
2931
|
+
|
|
2932
|
+
# return_type
|
|
2933
|
+
return_type = opts[:debug_return_type]
|
|
2934
|
+
|
|
2935
|
+
# auth_names
|
|
2936
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
2937
|
+
|
|
2938
|
+
new_options = opts.merge(
|
|
2939
|
+
:operation => :"CustomObjectsApi.update_object_schema_relationship",
|
|
2940
|
+
:header_params => header_params,
|
|
2941
|
+
:query_params => query_params,
|
|
2942
|
+
:form_params => form_params,
|
|
2943
|
+
:body => post_body,
|
|
2944
|
+
:auth_names => auth_names,
|
|
2945
|
+
:return_type => return_type
|
|
2946
|
+
)
|
|
2947
|
+
|
|
2948
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
2949
|
+
if @api_client.config.debugging
|
|
2950
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#update_object_schema_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2951
|
+
end
|
|
2952
|
+
return data, status_code, headers
|
|
2953
|
+
end
|
|
2954
|
+
|
|
2955
|
+
# alias of `update_object_schema_relationship_with_http_info`
|
|
2956
|
+
alias update_object_schema_relationships_schemas_with_http_info update_object_schema_relationship_with_http_info
|
|
2957
|
+
|
|
2958
|
+
# alias of `update_object_schema_relationship_with_http_info`
|
|
2959
|
+
alias update_schemas_for_object_schema_with_http_info update_object_schema_relationship_with_http_info
|
|
2960
|
+
|
|
2961
|
+
# Update Profile Schema Relationship
|
|
2962
|
+
# Update a relationship between an object schema and a profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_profile_schema_relationship.json)
|
|
2963
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2964
|
+
# @param profile_object_schema_relationship_partial_update_query [ProfileObjectSchemaRelationshipPartialUpdateQuery] Update a relationship between an object schema and a profile
|
|
2965
|
+
# @param [Hash] opts the optional parameters
|
|
2966
|
+
# @return [nil]
|
|
2967
|
+
def update_profile_schema_relationship(id, profile_object_schema_relationship_partial_update_query, opts = {})
|
|
2968
|
+
update_profile_schema_relationship_with_http_info(id, profile_object_schema_relationship_partial_update_query, opts)
|
|
2969
|
+
nil
|
|
2970
|
+
end
|
|
2971
|
+
|
|
2972
|
+
# alias of `update_profile_schema_relationship`
|
|
2973
|
+
alias update_object_schema_relationships_profile_object_schemas update_profile_schema_relationship
|
|
2974
|
+
|
|
2975
|
+
# alias of `update_profile_schema_relationship`
|
|
2976
|
+
alias update_profile_object_schemas_for_object_schema update_profile_schema_relationship
|
|
2977
|
+
|
|
2978
|
+
# Update Profile Schema Relationship
|
|
2979
|
+
# Update a relationship between an object schema and a profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_profile_schema_relationship.json)
|
|
2980
|
+
# @param id [String] The ULID ID of the object schema.
|
|
2981
|
+
# @param profile_object_schema_relationship_partial_update_query [ProfileObjectSchemaRelationshipPartialUpdateQuery] Update a relationship between an object schema and a profile
|
|
2982
|
+
# @param [Hash] opts the optional parameters
|
|
2983
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
2984
|
+
def update_profile_schema_relationship_with_http_info(id, profile_object_schema_relationship_partial_update_query, opts = {})
|
|
2985
|
+
if @api_client.config.debugging
|
|
2986
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.update_profile_schema_relationship ...'
|
|
2987
|
+
end
|
|
2988
|
+
# verify the required parameter 'id' is set
|
|
2989
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2990
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.update_profile_schema_relationship"
|
|
2991
|
+
end
|
|
2992
|
+
# verify the required parameter 'profile_object_schema_relationship_partial_update_query' is set
|
|
2993
|
+
if @api_client.config.client_side_validation && profile_object_schema_relationship_partial_update_query.nil?
|
|
2994
|
+
fail ArgumentError, "Missing the required parameter 'profile_object_schema_relationship_partial_update_query' when calling CustomObjectsApi.update_profile_schema_relationship"
|
|
2995
|
+
end
|
|
2996
|
+
# resource path
|
|
2997
|
+
local_var_path = '/api/object-schemas/{id}/relationships/profile-object-schemas'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
2998
|
+
|
|
2999
|
+
# query parameters
|
|
3000
|
+
query_params = opts[:query_params] || {}
|
|
3001
|
+
|
|
3002
|
+
# header parameters
|
|
3003
|
+
header_params = opts[:header_params] || {}
|
|
3004
|
+
# klaviyo api revision
|
|
3005
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
3006
|
+
# HTTP header 'Accept' (if needed)
|
|
3007
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
3008
|
+
# HTTP header 'Content-Type'
|
|
3009
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
3010
|
+
if !content_type.nil?
|
|
3011
|
+
header_params['Content-Type'] = content_type
|
|
3012
|
+
end
|
|
3013
|
+
|
|
3014
|
+
# form parameters
|
|
3015
|
+
form_params = opts[:form_params] || {}
|
|
3016
|
+
|
|
3017
|
+
# http body (model)
|
|
3018
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_object_schema_relationship_partial_update_query)
|
|
3019
|
+
|
|
3020
|
+
# return_type
|
|
3021
|
+
return_type = opts[:debug_return_type]
|
|
3022
|
+
|
|
3023
|
+
# auth_names
|
|
3024
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
3025
|
+
|
|
3026
|
+
new_options = opts.merge(
|
|
3027
|
+
:operation => :"CustomObjectsApi.update_profile_schema_relationship",
|
|
3028
|
+
:header_params => header_params,
|
|
3029
|
+
:query_params => query_params,
|
|
3030
|
+
:form_params => form_params,
|
|
3031
|
+
:body => post_body,
|
|
3032
|
+
:auth_names => auth_names,
|
|
3033
|
+
:return_type => return_type
|
|
3034
|
+
)
|
|
3035
|
+
|
|
3036
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
3037
|
+
if @api_client.config.debugging
|
|
3038
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#update_profile_schema_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
3039
|
+
end
|
|
3040
|
+
return data, status_code, headers
|
|
3041
|
+
end
|
|
3042
|
+
|
|
3043
|
+
# alias of `update_profile_schema_relationship_with_http_info`
|
|
3044
|
+
alias update_object_schema_relationships_profile_object_schemas_with_http_info update_profile_schema_relationship_with_http_info
|
|
3045
|
+
|
|
3046
|
+
# alias of `update_profile_schema_relationship_with_http_info`
|
|
3047
|
+
alias update_profile_object_schemas_for_object_schema_with_http_info update_profile_schema_relationship_with_http_info
|
|
3048
|
+
|
|
3049
|
+
# Update Source Mapping
|
|
3050
|
+
# Update the source mapping with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_source_mapping.json)
|
|
3051
|
+
# @param id [String] The ULID ID of the source mapping
|
|
3052
|
+
# @param source_mapping_partial_update_query [SourceMappingPartialUpdateQuery] Update a source mapping by ID
|
|
3053
|
+
# @param [Hash] opts the optional parameters
|
|
3054
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
3055
|
+
# @return [Hash<String, Object>]
|
|
3056
|
+
def update_source_mapping(id, source_mapping_partial_update_query, opts = {})
|
|
3057
|
+
data, _status_code, _headers = update_source_mapping_with_http_info(id, source_mapping_partial_update_query, opts)
|
|
3058
|
+
data
|
|
3059
|
+
end
|
|
3060
|
+
|
|
3061
|
+
# Update Source Mapping
|
|
3062
|
+
# Update the source mapping with the given ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `custom-objects:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_source_mapping.json)
|
|
3063
|
+
# @param id [String] The ULID ID of the source mapping
|
|
3064
|
+
# @param source_mapping_partial_update_query [SourceMappingPartialUpdateQuery] Update a source mapping by ID
|
|
3065
|
+
# @param [Hash] opts the optional parameters
|
|
3066
|
+
# @option opts [Array<String>] :fields_source_mapping For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
3067
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
3068
|
+
def update_source_mapping_with_http_info(id, source_mapping_partial_update_query, opts = {})
|
|
3069
|
+
if @api_client.config.debugging
|
|
3070
|
+
@api_client.config.logger.debug 'Calling API: CustomObjectsApi.update_source_mapping ...'
|
|
3071
|
+
end
|
|
3072
|
+
# verify the required parameter 'id' is set
|
|
3073
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
3074
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CustomObjectsApi.update_source_mapping"
|
|
3075
|
+
end
|
|
3076
|
+
# verify the required parameter 'source_mapping_partial_update_query' is set
|
|
3077
|
+
if @api_client.config.client_side_validation && source_mapping_partial_update_query.nil?
|
|
3078
|
+
fail ArgumentError, "Missing the required parameter 'source_mapping_partial_update_query' when calling CustomObjectsApi.update_source_mapping"
|
|
3079
|
+
end
|
|
3080
|
+
allowable_values = ["id", "property_mappings", "relationship_mappings"]
|
|
3081
|
+
if @api_client.config.client_side_validation && opts[:'fields_source_mapping'] && !opts[:'fields_source_mapping'].all? { |item| allowable_values.include?(item) }
|
|
3082
|
+
fail ArgumentError, "invalid value for \"fields_source_mapping\", must include one of #{allowable_values}"
|
|
3083
|
+
end
|
|
3084
|
+
# resource path
|
|
3085
|
+
local_var_path = '/api/source-mappings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
3086
|
+
|
|
3087
|
+
# query parameters
|
|
3088
|
+
query_params = opts[:query_params] || {}
|
|
3089
|
+
query_params[:'fields[source-mapping]'] = @api_client.build_collection_param(opts[:'fields_source_mapping'], :csv) if !opts[:'fields_source_mapping'].nil?
|
|
3090
|
+
|
|
3091
|
+
# header parameters
|
|
3092
|
+
header_params = opts[:header_params] || {}
|
|
3093
|
+
# klaviyo api revision
|
|
3094
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
3095
|
+
# HTTP header 'Accept' (if needed)
|
|
3096
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
3097
|
+
# HTTP header 'Content-Type'
|
|
3098
|
+
content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
|
|
3099
|
+
if !content_type.nil?
|
|
3100
|
+
header_params['Content-Type'] = content_type
|
|
3101
|
+
end
|
|
3102
|
+
|
|
3103
|
+
# form parameters
|
|
3104
|
+
form_params = opts[:form_params] || {}
|
|
3105
|
+
|
|
3106
|
+
# http body (model)
|
|
3107
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(source_mapping_partial_update_query)
|
|
3108
|
+
|
|
3109
|
+
# return_type
|
|
3110
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
3111
|
+
|
|
3112
|
+
# auth_names
|
|
3113
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
|
3114
|
+
|
|
3115
|
+
new_options = opts.merge(
|
|
3116
|
+
:operation => :"CustomObjectsApi.update_source_mapping",
|
|
3117
|
+
:header_params => header_params,
|
|
3118
|
+
:query_params => query_params,
|
|
3119
|
+
:form_params => form_params,
|
|
3120
|
+
:body => post_body,
|
|
3121
|
+
:auth_names => auth_names,
|
|
3122
|
+
:return_type => return_type
|
|
3123
|
+
)
|
|
3124
|
+
|
|
3125
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
3126
|
+
if @api_client.config.debugging
|
|
3127
|
+
@api_client.config.logger.debug "API called: CustomObjectsApi#update_source_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
456
3128
|
end
|
|
457
3129
|
return data, status_code, headers
|
|
458
3130
|
end
|