klaviyo-api-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +9 -0
- data/LICENSE.md +21 -0
- data/README.md +1316 -0
- data/Rakefile +10 -0
- data/docs/CatalogCategoryCreateJobCreateQuery.md +18 -0
- data/docs/CatalogCategoryCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogCategoryCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogCategoryCreateQuery.md +18 -0
- data/docs/CatalogCategoryCreateQueryAsSubResource.md +22 -0
- data/docs/CatalogCategoryCreateQueryAsSubResourceAttributes.md +24 -0
- data/docs/CatalogCategoryDeleteJobCreateQuery.md +18 -0
- data/docs/CatalogCategoryDeleteJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogCategoryDeleteJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogCategoryDeleteQueryAsSubResource.md +20 -0
- data/docs/CatalogCategoryItemOp.md +18 -0
- data/docs/CatalogCategoryUpdateJobCreateQuery.md +18 -0
- data/docs/CatalogCategoryUpdateJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogCategoryUpdateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogCategoryUpdateQuery.md +18 -0
- data/docs/CatalogCategoryUpdateQueryAsSubResource.md +24 -0
- data/docs/CatalogCategoryUpdateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogItemCategoryOp.md +18 -0
- data/docs/CatalogItemCreateJobCreateQuery.md +18 -0
- data/docs/CatalogItemCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogItemCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogItemCreateQuery.md +18 -0
- data/docs/CatalogItemCreateQueryAsSubResource.md +22 -0
- data/docs/CatalogItemCreateQueryAsSubResourceAttributes.md +38 -0
- data/docs/CatalogItemCreateQueryAsSubResourceRelationships.md +18 -0
- data/docs/CatalogItemCreateQueryAsSubResourceRelationshipsCategories.md +18 -0
- data/docs/CatalogItemCreateQueryAsSubResourceRelationshipsCategoriesDataInner.md +20 -0
- data/docs/CatalogItemDeleteJobCreateQuery.md +18 -0
- data/docs/CatalogItemDeleteJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogItemDeleteJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogItemDeleteQueryAsSubResource.md +20 -0
- data/docs/CatalogItemUpdateJobCreateQuery.md +18 -0
- data/docs/CatalogItemUpdateJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogItemUpdateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogItemUpdateQuery.md +18 -0
- data/docs/CatalogItemUpdateQueryAsSubResource.md +24 -0
- data/docs/CatalogItemUpdateQueryAsSubResourceAttributes.md +32 -0
- data/docs/CatalogJobErrorPayload.md +26 -0
- data/docs/CatalogVariantCreateJobCreateQuery.md +18 -0
- data/docs/CatalogVariantCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogVariantCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogVariantCreateQuery.md +18 -0
- data/docs/CatalogVariantCreateQueryAsSubResource.md +22 -0
- data/docs/CatalogVariantCreateQueryAsSubResourceAttributes.md +46 -0
- data/docs/CatalogVariantCreateQueryAsSubResourceRelationships.md +18 -0
- data/docs/CatalogVariantCreateQueryAsSubResourceRelationshipsItems.md +18 -0
- data/docs/CatalogVariantCreateQueryAsSubResourceRelationshipsItemsDataInner.md +20 -0
- data/docs/CatalogVariantDeleteJobCreateQuery.md +18 -0
- data/docs/CatalogVariantDeleteJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogVariantDeleteJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogVariantDeleteQueryAsSubResource.md +20 -0
- data/docs/CatalogVariantUpdateJobCreateQuery.md +18 -0
- data/docs/CatalogVariantUpdateJobCreateQueryAsSubResource.md +20 -0
- data/docs/CatalogVariantUpdateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CatalogVariantUpdateQuery.md +18 -0
- data/docs/CatalogVariantUpdateQueryAsSubResource.md +22 -0
- data/docs/CatalogVariantUpdateQueryAsSubResourceAttributes.md +38 -0
- data/docs/CatalogsApi.md +4048 -0
- data/docs/ClientApi.md +205 -0
- data/docs/EmailMessageContent.md +24 -0
- data/docs/EmailTrackingOptions.md +24 -0
- data/docs/ErrorSource.md +18 -0
- data/docs/EventCreateQuery.md +18 -0
- data/docs/EventCreateQueryAsSubResource.md +20 -0
- data/docs/EventCreateQueryAsSubResourceAttributes.md +28 -0
- data/docs/EventsApi.md +472 -0
- data/docs/FlowUpdateQuery.md +18 -0
- data/docs/FlowUpdateQueryAsSubResource.md +22 -0
- data/docs/FlowUpdateQueryAsSubResourceAttributes.md +18 -0
- data/docs/FlowsApi.md +951 -0
- data/docs/GetCatalogItems4XXResponse.md +18 -0
- data/docs/GetCatalogItems4XXResponseErrorsInner.md +26 -0
- data/docs/GetCatalogItems4XXResponseErrorsInnerSource.md +20 -0
- data/docs/IncludedCategories.md +24 -0
- data/docs/IncludedCategoriesAttributes.md +22 -0
- data/docs/IncludedFlowAction.md +24 -0
- data/docs/IncludedFlowActions.md +24 -0
- data/docs/IncludedFlowActionsAttributes.md +32 -0
- data/docs/IncludedFlowActionsAttributesTrackingOptions.md +49 -0
- data/docs/IncludedFlowMessages.md +24 -0
- data/docs/IncludedFlowMessagesAttributes.md +26 -0
- data/docs/IncludedFlowMessagesAttributesContent.md +49 -0
- data/docs/IncludedFlows.md +24 -0
- data/docs/IncludedFlowsAttributes.md +28 -0
- data/docs/IncludedItems.md +24 -0
- data/docs/IncludedItemsAttributes.md +38 -0
- data/docs/IncludedLists.md +24 -0
- data/docs/IncludedListsAttributes.md +22 -0
- data/docs/IncludedMetrics.md +24 -0
- data/docs/IncludedMetricsAttributes.md +24 -0
- data/docs/IncludedProfile.md +24 -0
- data/docs/IncludedProfiles.md +24 -0
- data/docs/IncludedProfilesAttributes.md +44 -0
- data/docs/IncludedSegments.md +24 -0
- data/docs/IncludedVariants.md +24 -0
- data/docs/IncludedVariantsAttributes.md +46 -0
- data/docs/IncludedVariantsLinks.md +18 -0
- data/docs/ListCreateQuery.md +18 -0
- data/docs/ListCreateQueryAsSubResource.md +20 -0
- data/docs/ListCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/ListDeleteQueryAsSubResource.md +20 -0
- data/docs/ListMembersAddQuery.md +18 -0
- data/docs/ListMembersAddQueryDataInner.md +20 -0
- data/docs/ListMembersDeleteQuery.md +18 -0
- data/docs/ListPartialUpdateQuery.md +18 -0
- data/docs/ListPartialUpdateQueryAsSubResource.md +22 -0
- data/docs/ListsApi.md +686 -0
- data/docs/MetricAggregateQuery.md +18 -0
- data/docs/MetricAggregateQueryAsSubResource.md +20 -0
- data/docs/MetricAggregateQueryAsSubResourceAttributes.md +36 -0
- data/docs/MetricAggregateRowDTO.md +20 -0
- data/docs/MetricCreateQuery.md +20 -0
- data/docs/MetricsApi.md +233 -0
- data/docs/OnsiteProfileCreateQuery.md +18 -0
- data/docs/OnsiteProfileCreateQueryAsSubResource.md +22 -0
- data/docs/OnsiteProfileMeta.md +18 -0
- data/docs/OnsiteProfileMetaIdentifiers.md +28 -0
- data/docs/OnsiteSubscriptionCreateQuery.md +18 -0
- data/docs/OnsiteSubscriptionCreateQueryAsSubResource.md +20 -0
- data/docs/OnsiteSubscriptionCreateQueryAsSubResourceAttributes.md +26 -0
- data/docs/ProfileCreateQuery.md +18 -0
- data/docs/ProfileCreateQueryAsSubResource.md +20 -0
- data/docs/ProfileCreateQueryAsSubResourceAttributes.md +38 -0
- data/docs/ProfileLocation.md +34 -0
- data/docs/ProfileLocationLatitude.md +49 -0
- data/docs/ProfilePartialUpdateQuery.md +18 -0
- data/docs/ProfilePartialUpdateQueryAsSubResource.md +22 -0
- data/docs/ProfilesApi.md +825 -0
- data/docs/SMSMessageContent.md +20 -0
- data/docs/SMSRenderOptions.md +24 -0
- data/docs/SMSTrackingOptions.md +20 -0
- data/docs/SegmentPartialUpdateQuery.md +18 -0
- data/docs/SegmentPartialUpdateQueryAsSubResource.md +22 -0
- data/docs/SegmentsApi.md +390 -0
- data/docs/SendOptions.md +20 -0
- data/docs/Subscription.md +20 -0
- data/docs/SubscriptionCreateJobCreateQuery.md +18 -0
- data/docs/SubscriptionCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/SubscriptionCreateJobCreateQueryAsSubResourceAttributes.md +22 -0
- data/docs/Suppression.md +18 -0
- data/docs/SuppressionCreateJobCreateQuery.md +18 -0
- data/docs/SuppressionCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/SuppressionCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/TemplateCloneQuery.md +18 -0
- data/docs/TemplateCloneQueryAsSubResource.md +20 -0
- data/docs/TemplateCloneQueryAsSubResourceAttributes.md +20 -0
- data/docs/TemplateCreateQuery.md +18 -0
- data/docs/TemplateCreateQueryAsSubResource.md +20 -0
- data/docs/TemplateCreateQueryAsSubResourceAttributes.md +26 -0
- data/docs/TemplateDeleteQueryAsSubResource.md +20 -0
- data/docs/TemplateUpdateQuery.md +18 -0
- data/docs/TemplateUpdateQueryAsSubResource.md +22 -0
- data/docs/TemplateUpdateQueryAsSubResourceAttributes.md +24 -0
- data/docs/TemplatesApi.md +529 -0
- data/docs/UnsubscriptionCreateJobCreateQuery.md +18 -0
- data/docs/UnsubscriptionCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/UnsubscriptionCreateJobCreateQueryAsSubResourceAttributes.md +22 -0
- data/docs/UnsuppressionCreateJobCreateQuery.md +18 -0
- data/docs/UnsuppressionCreateJobCreateQueryAsSubResource.md +20 -0
- data/docs/UtmParamInfo.md +20 -0
- data/docs/V2TemplateRenderQuery.md +18 -0
- data/docs/V2TemplateRenderQueryAsSubResource.md +20 -0
- data/docs/V2TemplateRenderQueryAsSubResourceAttributes.md +20 -0
- data/git_push.sh +57 -0
- data/klaviyo-api-sdk.gemspec +40 -0
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +4095 -0
- data/lib/klaviyo-api-sdk/api/client_api.rb +249 -0
- data/lib/klaviyo-api-sdk/api/events_api.rb +505 -0
- data/lib/klaviyo-api-sdk/api/flows_api.rb +1009 -0
- data/lib/klaviyo-api-sdk/api/lists_api.rb +708 -0
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +236 -0
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +840 -0
- data/lib/klaviyo-api-sdk/api/segments_api.rb +392 -0
- data/lib/klaviyo-api-sdk/api/templates_api.rb +536 -0
- data/lib/klaviyo-api-sdk/api_client.rb +390 -0
- data/lib/klaviyo-api-sdk/api_error.rb +57 -0
- data/lib/klaviyo-api-sdk/configuration.rb +283 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_query_as_sub_resource.rb +281 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_query_as_sub_resource_attributes.rb +291 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_update_query_as_sub_resource.rb +295 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_update_query_as_sub_resource_attributes.rb +219 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource.rb +281 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_attributes.rb +366 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships.rb +219 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships_categories.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships_categories_data_inner.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_update_query_as_sub_resource.rb +295 -0
- data/lib/klaviyo-api-sdk/models/catalog_item_update_query_as_sub_resource_attributes.rb +284 -0
- data/lib/klaviyo-api-sdk/models/catalog_job_error_payload.rb +280 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource.rb +281 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_attributes.rb +435 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships.rb +219 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships_items.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships_items_data_inner.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_query_as_sub_resource.rb +286 -0
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_query_as_sub_resource_attributes.rb +346 -0
- data/lib/klaviyo-api-sdk/models/email_message_content.rb +266 -0
- data/lib/klaviyo-api-sdk/models/email_tracking_options.rb +268 -0
- data/lib/klaviyo-api-sdk/models/error_source.rb +224 -0
- data/lib/klaviyo-api-sdk/models/event_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/event_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/event_create_query_as_sub_resource_attributes.rb +279 -0
- data/lib/klaviyo-api-sdk/models/flow_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/flow_update_query_as_sub_resource.rb +286 -0
- data/lib/klaviyo-api-sdk/models/flow_update_query_as_sub_resource_attributes.rb +224 -0
- data/lib/klaviyo-api-sdk/models/get_catalog_items4_xx_response.rb +226 -0
- data/lib/klaviyo-api-sdk/models/get_catalog_items4_xx_response_errors_inner.rb +275 -0
- data/lib/klaviyo-api-sdk/models/get_catalog_items4_xx_response_errors_inner_source.rb +228 -0
- data/lib/klaviyo-api-sdk/models/included_categories.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_categories_attributes.rb +237 -0
- data/lib/klaviyo-api-sdk/models/included_flow_action.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_flow_actions.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_flow_actions_attributes.rb +282 -0
- data/lib/klaviyo-api-sdk/models/included_flow_actions_attributes_tracking_options.rb +105 -0
- data/lib/klaviyo-api-sdk/models/included_flow_messages.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_flow_messages_attributes.rb +270 -0
- data/lib/klaviyo-api-sdk/models/included_flow_messages_attributes_content.rb +105 -0
- data/lib/klaviyo-api-sdk/models/included_flows.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_flows_attributes.rb +264 -0
- data/lib/klaviyo-api-sdk/models/included_items.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_items_attributes.rb +311 -0
- data/lib/klaviyo-api-sdk/models/included_lists.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_lists_attributes.rb +237 -0
- data/lib/klaviyo-api-sdk/models/included_metrics.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_metrics_attributes.rb +246 -0
- data/lib/klaviyo-api-sdk/models/included_profile.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_profiles.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_profiles_attributes.rb +336 -0
- data/lib/klaviyo-api-sdk/models/included_segments.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_variants.rb +300 -0
- data/lib/klaviyo-api-sdk/models/included_variants_attributes.rb +382 -0
- data/lib/klaviyo-api-sdk/models/included_variants_links.rb +224 -0
- data/lib/klaviyo-api-sdk/models/list_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/list_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/list_create_query_as_sub_resource_attributes.rb +224 -0
- data/lib/klaviyo-api-sdk/models/list_delete_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/list_members_add_query.rb +226 -0
- data/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb +272 -0
- data/lib/klaviyo-api-sdk/models/list_members_delete_query.rb +226 -0
- data/lib/klaviyo-api-sdk/models/list_partial_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/list_partial_update_query_as_sub_resource.rb +286 -0
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_as_sub_resource_attributes.rb +380 -0
- data/lib/klaviyo-api-sdk/models/metric_aggregate_row_dto.rb +240 -0
- data/lib/klaviyo-api-sdk/models/metric_create_query.rb +233 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_create_query_as_sub_resource.rb +281 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +224 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta_identifiers.rb +264 -0
- data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query_as_sub_resource_attributes.rb +260 -0
- data/lib/klaviyo-api-sdk/models/profile_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/profile_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/profile_create_query_as_sub_resource_attributes.rb +309 -0
- data/lib/klaviyo-api-sdk/models/profile_location.rb +291 -0
- data/lib/klaviyo-api-sdk/models/profile_location_latitude.rb +105 -0
- data/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/profile_partial_update_query_as_sub_resource.rb +286 -0
- data/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/segment_partial_update_query_as_sub_resource.rb +286 -0
- data/lib/klaviyo-api-sdk/models/send_options.rb +238 -0
- data/lib/klaviyo-api-sdk/models/sms_message_content.rb +238 -0
- data/lib/klaviyo-api-sdk/models/sms_render_options.rb +266 -0
- data/lib/klaviyo-api-sdk/models/sms_tracking_options.rb +240 -0
- data/lib/klaviyo-api-sdk/models/subscription.rb +228 -0
- data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_as_sub_resource_attributes.rb +249 -0
- data/lib/klaviyo-api-sdk/models/suppression.rb +224 -0
- data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_as_sub_resource_attributes.rb +226 -0
- data/lib/klaviyo-api-sdk/models/template_clone_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/template_clone_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/template_clone_query_as_sub_resource_attributes.rb +230 -0
- data/lib/klaviyo-api-sdk/models/template_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/template_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/template_create_query_as_sub_resource_attributes.rb +267 -0
- data/lib/klaviyo-api-sdk/models/template_delete_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/template_update_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/template_update_query_as_sub_resource.rb +286 -0
- data/lib/klaviyo-api-sdk/models/template_update_query_as_sub_resource_attributes.rb +248 -0
- data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query_as_sub_resource_attributes.rb +246 -0
- data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/utm_param_info.rb +238 -0
- data/lib/klaviyo-api-sdk/models/v2_template_render_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/v2_template_render_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/v2_template_render_query_as_sub_resource_attributes.rb +235 -0
- data/lib/klaviyo-api-sdk/version.rb +15 -0
- data/lib/klaviyo-api-sdk.rb +253 -0
- data/spec/api/catalogs_api_spec.rb +759 -0
- data/spec/api/client_api_spec.rb +74 -0
- data/spec/api/events_api_spec.rb +120 -0
- data/spec/api/flows_api_spec.rb +209 -0
- data/spec/api/lists_api_spec.rb +156 -0
- data/spec/api/metrics_api_spec.rb +74 -0
- data/spec/api/profiles_api_spec.rb +178 -0
- data/spec/api/segments_api_spec.rb +103 -0
- data/spec/api/templates_api_spec.rb +126 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/catalog_category_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_category_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_category_create_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_category_create_query_as_sub_resource_attributes_spec.rb +56 -0
- data/spec/models/catalog_category_create_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/catalog_category_create_query_spec.rb +34 -0
- data/spec/models/catalog_category_delete_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_category_delete_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_category_delete_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_category_delete_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_category_item_op_spec.rb +34 -0
- data/spec/models/catalog_category_update_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_category_update_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_category_update_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_category_update_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_category_update_query_as_sub_resource_spec.rb +56 -0
- data/spec/models/catalog_category_update_query_spec.rb +34 -0
- data/spec/models/catalog_item_category_op_spec.rb +34 -0
- data/spec/models/catalog_item_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_item_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_item_create_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_item_create_query_as_sub_resource_attributes_spec.rb +98 -0
- data/spec/models/catalog_item_create_query_as_sub_resource_relationships_categories_data_inner_spec.rb +44 -0
- data/spec/models/catalog_item_create_query_as_sub_resource_relationships_categories_spec.rb +34 -0
- data/spec/models/catalog_item_create_query_as_sub_resource_relationships_spec.rb +34 -0
- data/spec/models/catalog_item_create_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/catalog_item_create_query_spec.rb +34 -0
- data/spec/models/catalog_item_delete_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_item_delete_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_item_delete_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_item_delete_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_item_update_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_item_update_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_item_update_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_item_update_query_as_sub_resource_attributes_spec.rb +76 -0
- data/spec/models/catalog_item_update_query_as_sub_resource_spec.rb +56 -0
- data/spec/models/catalog_item_update_query_spec.rb +34 -0
- data/spec/models/catalog_job_error_payload_spec.rb +58 -0
- data/spec/models/catalog_variant_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_variant_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_variant_create_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_variant_create_query_as_sub_resource_attributes_spec.rb +126 -0
- data/spec/models/catalog_variant_create_query_as_sub_resource_relationships_items_data_inner_spec.rb +44 -0
- data/spec/models/catalog_variant_create_query_as_sub_resource_relationships_items_spec.rb +34 -0
- data/spec/models/catalog_variant_create_query_as_sub_resource_relationships_spec.rb +34 -0
- data/spec/models/catalog_variant_create_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/catalog_variant_create_query_spec.rb +34 -0
- data/spec/models/catalog_variant_delete_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_variant_delete_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_variant_delete_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_variant_delete_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_variant_update_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/catalog_variant_update_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/catalog_variant_update_job_create_query_spec.rb +34 -0
- data/spec/models/catalog_variant_update_query_as_sub_resource_attributes_spec.rb +98 -0
- data/spec/models/catalog_variant_update_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/catalog_variant_update_query_spec.rb +34 -0
- data/spec/models/email_message_content_spec.rb +52 -0
- data/spec/models/email_tracking_options_spec.rb +52 -0
- data/spec/models/error_source_spec.rb +34 -0
- data/spec/models/event_create_query_as_sub_resource_attributes_spec.rb +64 -0
- data/spec/models/event_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/event_create_query_spec.rb +34 -0
- data/spec/models/flow_update_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/flow_update_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/flow_update_query_spec.rb +34 -0
- data/spec/models/get_catalog_items4_xx_response_errors_inner_source_spec.rb +40 -0
- data/spec/models/get_catalog_items4_xx_response_errors_inner_spec.rb +58 -0
- data/spec/models/get_catalog_items4_xx_response_spec.rb +34 -0
- data/spec/models/included_categories_attributes_spec.rb +46 -0
- data/spec/models/included_categories_spec.rb +56 -0
- data/spec/models/included_flow_action_spec.rb +56 -0
- data/spec/models/included_flow_actions_attributes_spec.rb +76 -0
- data/spec/models/included_flow_actions_attributes_tracking_options_spec.rb +31 -0
- data/spec/models/included_flow_actions_spec.rb +56 -0
- data/spec/models/included_flow_messages_attributes_content_spec.rb +31 -0
- data/spec/models/included_flow_messages_attributes_spec.rb +58 -0
- data/spec/models/included_flow_messages_spec.rb +56 -0
- data/spec/models/included_flows_attributes_spec.rb +64 -0
- data/spec/models/included_flows_spec.rb +56 -0
- data/spec/models/included_items_attributes_spec.rb +94 -0
- data/spec/models/included_items_spec.rb +56 -0
- data/spec/models/included_lists_attributes_spec.rb +46 -0
- data/spec/models/included_lists_spec.rb +56 -0
- data/spec/models/included_metrics_attributes_spec.rb +52 -0
- data/spec/models/included_metrics_spec.rb +56 -0
- data/spec/models/included_profile_spec.rb +56 -0
- data/spec/models/included_profiles_attributes_spec.rb +112 -0
- data/spec/models/included_profiles_spec.rb +56 -0
- data/spec/models/included_segments_spec.rb +56 -0
- data/spec/models/included_variants_attributes_spec.rb +122 -0
- data/spec/models/included_variants_links_spec.rb +34 -0
- data/spec/models/included_variants_spec.rb +56 -0
- data/spec/models/list_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/list_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/list_create_query_spec.rb +34 -0
- data/spec/models/list_delete_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/list_members_add_query_data_inner_spec.rb +44 -0
- data/spec/models/list_members_add_query_spec.rb +34 -0
- data/spec/models/list_members_delete_query_spec.rb +34 -0
- data/spec/models/list_partial_update_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/list_partial_update_query_spec.rb +34 -0
- data/spec/models/metric_aggregate_query_as_sub_resource_attributes_spec.rb +104 -0
- data/spec/models/metric_aggregate_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/metric_aggregate_query_spec.rb +34 -0
- data/spec/models/metric_aggregate_row_dto_spec.rb +40 -0
- data/spec/models/metric_create_query_spec.rb +40 -0
- data/spec/models/onsite_profile_create_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/onsite_profile_create_query_spec.rb +34 -0
- data/spec/models/onsite_profile_meta_identifiers_spec.rb +64 -0
- data/spec/models/onsite_profile_meta_spec.rb +34 -0
- data/spec/models/onsite_subscription_create_query_as_sub_resource_attributes_spec.rb +58 -0
- data/spec/models/onsite_subscription_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/onsite_subscription_create_query_spec.rb +34 -0
- data/spec/models/profile_create_query_as_sub_resource_attributes_spec.rb +94 -0
- data/spec/models/profile_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/profile_create_query_spec.rb +34 -0
- data/spec/models/profile_location_latitude_spec.rb +31 -0
- data/spec/models/profile_location_spec.rb +82 -0
- data/spec/models/profile_partial_update_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/profile_partial_update_query_spec.rb +34 -0
- data/spec/models/segment_partial_update_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/segment_partial_update_query_spec.rb +34 -0
- data/spec/models/send_options_spec.rb +40 -0
- data/spec/models/sms_message_content_spec.rb +40 -0
- data/spec/models/sms_render_options_spec.rb +52 -0
- data/spec/models/sms_tracking_options_spec.rb +40 -0
- data/spec/models/subscription_create_job_create_query_as_sub_resource_attributes_spec.rb +46 -0
- data/spec/models/subscription_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/subscription_create_job_create_query_spec.rb +34 -0
- data/spec/models/subscription_spec.rb +40 -0
- data/spec/models/suppression_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/suppression_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/suppression_create_job_create_query_spec.rb +34 -0
- data/spec/models/suppression_spec.rb +34 -0
- data/spec/models/template_clone_query_as_sub_resource_attributes_spec.rb +40 -0
- data/spec/models/template_clone_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/template_clone_query_spec.rb +34 -0
- data/spec/models/template_create_query_as_sub_resource_attributes_spec.rb +58 -0
- data/spec/models/template_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/template_create_query_spec.rb +34 -0
- data/spec/models/template_delete_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/template_update_query_as_sub_resource_attributes_spec.rb +52 -0
- data/spec/models/template_update_query_as_sub_resource_spec.rb +50 -0
- data/spec/models/template_update_query_spec.rb +34 -0
- data/spec/models/unsubscription_create_job_create_query_as_sub_resource_attributes_spec.rb +46 -0
- data/spec/models/unsubscription_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/unsubscription_create_job_create_query_spec.rb +34 -0
- data/spec/models/unsuppression_create_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/unsuppression_create_job_create_query_spec.rb +34 -0
- data/spec/models/utm_param_info_spec.rb +40 -0
- data/spec/models/v2_template_render_query_as_sub_resource_attributes_spec.rb +40 -0
- data/spec/models/v2_template_render_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/v2_template_render_query_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- metadata +583 -0
@@ -0,0 +1,505 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022-10-17
|
7
|
+
Contact: developers@klaviyo.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module KlaviyoAPI
|
16
|
+
class EventsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create Event
|
23
|
+
# Create an event. Events are created asynchronously. Successful response indicates that the event was validated and submitted for processing, but does not guarantee that processing is complete.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Write`
|
24
|
+
# @param event_create_query [EventCreateQuery] Event to create.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def create_event(event_create_query, opts = {})
|
28
|
+
create_event_with_http_info(event_create_query, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create Event
|
33
|
+
# Create an event. Events are created asynchronously. Successful response indicates that the event was validated and submitted for processing, but does not guarantee that processing is complete.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Write`
|
34
|
+
# @param event_create_query [EventCreateQuery] Event to create.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def create_event_with_http_info(event_create_query, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.create_event ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'event_create_query' is set
|
42
|
+
if @api_client.config.client_side_validation && event_create_query.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'event_create_query' when calling EventsApi.create_event"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/api/events/'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# klaviyo api revision
|
54
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
+
# HTTP header 'Content-Type'
|
58
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
59
|
+
if !content_type.nil?
|
60
|
+
header_params['Content-Type'] = content_type
|
61
|
+
end
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = opts[:form_params] || {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(event_create_query)
|
68
|
+
|
69
|
+
# return_type
|
70
|
+
return_type = opts[:debug_return_type]
|
71
|
+
|
72
|
+
# auth_names
|
73
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
74
|
+
|
75
|
+
new_options = opts.merge(
|
76
|
+
:operation => :"EventsApi.create_event",
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: EventsApi#create_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Get Event
|
93
|
+
# Get an event with the given event ID. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `metrics`, `profiles`<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Events Read`
|
94
|
+
# @param id [String]
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @option opts [Array<String>] :fields_event For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
97
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
98
|
+
# @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
99
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
100
|
+
# @return [Hash<String, Object>]
|
101
|
+
def get_event(id, opts = {})
|
102
|
+
data, _status_code, _headers = get_event_with_http_info(id, opts)
|
103
|
+
data
|
104
|
+
end
|
105
|
+
|
106
|
+
# Get Event
|
107
|
+
# Get an event with the given event ID. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `metrics`, `profiles`<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Events Read`
|
108
|
+
# @param id [String]
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @option opts [Array<String>] :fields_event For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
111
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
112
|
+
# @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
113
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
114
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
115
|
+
def get_event_with_http_info(id, opts = {})
|
116
|
+
if @api_client.config.debugging
|
117
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_event ...'
|
118
|
+
end
|
119
|
+
# verify the required parameter 'id' is set
|
120
|
+
if @api_client.config.client_side_validation && id.nil?
|
121
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_event"
|
122
|
+
end
|
123
|
+
allowable_values = ["metric_id", "profile_id", "timestamp", "event_properties", "datetime", "uuid"]
|
124
|
+
if @api_client.config.client_side_validation && opts[:'fields_event'] && !opts[:'fields_event'].all? { |item| allowable_values.include?(item) }
|
125
|
+
fail ArgumentError, "invalid value for \"fields_event\", must include one of #{allowable_values}"
|
126
|
+
end
|
127
|
+
allowable_values = ["name", "created", "updated", "integration"]
|
128
|
+
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
129
|
+
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
130
|
+
end
|
131
|
+
allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"]
|
132
|
+
if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
|
133
|
+
fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
|
134
|
+
end
|
135
|
+
allowable_values = ["metrics", "profiles"]
|
136
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
137
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
138
|
+
end
|
139
|
+
# resource path
|
140
|
+
local_var_path = '/api/events/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
141
|
+
|
142
|
+
# query parameters
|
143
|
+
query_params = opts[:query_params] || {}
|
144
|
+
query_params[:'fields[event]'] = @api_client.build_collection_param(opts[:'fields_event'], :csv) if !opts[:'fields_event'].nil?
|
145
|
+
query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
|
146
|
+
query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
|
147
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
148
|
+
|
149
|
+
# header parameters
|
150
|
+
header_params = opts[:header_params] || {}
|
151
|
+
# klaviyo api revision
|
152
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
153
|
+
# HTTP header 'Accept' (if needed)
|
154
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
155
|
+
|
156
|
+
# form parameters
|
157
|
+
form_params = opts[:form_params] || {}
|
158
|
+
|
159
|
+
# http body (model)
|
160
|
+
post_body = opts[:debug_body]
|
161
|
+
|
162
|
+
# return_type
|
163
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
164
|
+
|
165
|
+
# auth_names
|
166
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
167
|
+
|
168
|
+
new_options = opts.merge(
|
169
|
+
:operation => :"EventsApi.get_event",
|
170
|
+
:header_params => header_params,
|
171
|
+
:query_params => query_params,
|
172
|
+
:form_params => form_params,
|
173
|
+
:body => post_body,
|
174
|
+
:auth_names => auth_names,
|
175
|
+
:return_type => return_type
|
176
|
+
)
|
177
|
+
|
178
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
179
|
+
if @api_client.config.debugging
|
180
|
+
@api_client.config.logger.debug "API called: EventsApi#get_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
181
|
+
end
|
182
|
+
return data, status_code, headers
|
183
|
+
end
|
184
|
+
|
185
|
+
# Get Event Metrics
|
186
|
+
# Get the metric for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Metrics Read`
|
187
|
+
# @param id [String]
|
188
|
+
# @param [Hash] opts the optional parameters
|
189
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
190
|
+
# @return [Hash<String, Object>]
|
191
|
+
def get_event_metrics(id, opts = {})
|
192
|
+
data, _status_code, _headers = get_event_metrics_with_http_info(id, opts)
|
193
|
+
data
|
194
|
+
end
|
195
|
+
|
196
|
+
# Get Event Metrics
|
197
|
+
# Get the metric for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Metrics Read`
|
198
|
+
# @param id [String]
|
199
|
+
# @param [Hash] opts the optional parameters
|
200
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
201
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
202
|
+
def get_event_metrics_with_http_info(id, opts = {})
|
203
|
+
if @api_client.config.debugging
|
204
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_event_metrics ...'
|
205
|
+
end
|
206
|
+
# verify the required parameter 'id' is set
|
207
|
+
if @api_client.config.client_side_validation && id.nil?
|
208
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_event_metrics"
|
209
|
+
end
|
210
|
+
allowable_values = ["name", "created", "updated", "integration"]
|
211
|
+
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
212
|
+
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
213
|
+
end
|
214
|
+
# resource path
|
215
|
+
local_var_path = '/api/events/{id}/metrics/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
216
|
+
|
217
|
+
# query parameters
|
218
|
+
query_params = opts[:query_params] || {}
|
219
|
+
query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
|
220
|
+
|
221
|
+
# header parameters
|
222
|
+
header_params = opts[:header_params] || {}
|
223
|
+
# klaviyo api revision
|
224
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
225
|
+
# HTTP header 'Accept' (if needed)
|
226
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
227
|
+
|
228
|
+
# form parameters
|
229
|
+
form_params = opts[:form_params] || {}
|
230
|
+
|
231
|
+
# http body (model)
|
232
|
+
post_body = opts[:debug_body]
|
233
|
+
|
234
|
+
# return_type
|
235
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
236
|
+
|
237
|
+
# auth_names
|
238
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
239
|
+
|
240
|
+
new_options = opts.merge(
|
241
|
+
:operation => :"EventsApi.get_event_metrics",
|
242
|
+
:header_params => header_params,
|
243
|
+
:query_params => query_params,
|
244
|
+
:form_params => form_params,
|
245
|
+
:body => post_body,
|
246
|
+
:auth_names => auth_names,
|
247
|
+
:return_type => return_type
|
248
|
+
)
|
249
|
+
|
250
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
251
|
+
if @api_client.config.debugging
|
252
|
+
@api_client.config.logger.debug "API called: EventsApi#get_event_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
253
|
+
end
|
254
|
+
return data, status_code, headers
|
255
|
+
end
|
256
|
+
|
257
|
+
# Get Event Profiles
|
258
|
+
# Get the profile associated with an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Profiles Read`
|
259
|
+
# @param id [String]
|
260
|
+
# @param [Hash] opts the optional parameters
|
261
|
+
# @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
262
|
+
# @return [Hash<String, Object>]
|
263
|
+
def get_event_profiles(id, opts = {})
|
264
|
+
data, _status_code, _headers = get_event_profiles_with_http_info(id, opts)
|
265
|
+
data
|
266
|
+
end
|
267
|
+
|
268
|
+
# Get Event Profiles
|
269
|
+
# Get the profile associated with an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Profiles Read`
|
270
|
+
# @param id [String]
|
271
|
+
# @param [Hash] opts the optional parameters
|
272
|
+
# @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
273
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
274
|
+
def get_event_profiles_with_http_info(id, opts = {})
|
275
|
+
if @api_client.config.debugging
|
276
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_event_profiles ...'
|
277
|
+
end
|
278
|
+
# verify the required parameter 'id' is set
|
279
|
+
if @api_client.config.client_side_validation && id.nil?
|
280
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_event_profiles"
|
281
|
+
end
|
282
|
+
allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"]
|
283
|
+
if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
|
284
|
+
fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
|
285
|
+
end
|
286
|
+
# resource path
|
287
|
+
local_var_path = '/api/events/{id}/profiles/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
288
|
+
|
289
|
+
# query parameters
|
290
|
+
query_params = opts[:query_params] || {}
|
291
|
+
query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
|
292
|
+
|
293
|
+
# header parameters
|
294
|
+
header_params = opts[:header_params] || {}
|
295
|
+
# klaviyo api revision
|
296
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
297
|
+
# HTTP header 'Accept' (if needed)
|
298
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
299
|
+
|
300
|
+
# form parameters
|
301
|
+
form_params = opts[:form_params] || {}
|
302
|
+
|
303
|
+
# http body (model)
|
304
|
+
post_body = opts[:debug_body]
|
305
|
+
|
306
|
+
# return_type
|
307
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
308
|
+
|
309
|
+
# auth_names
|
310
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
311
|
+
|
312
|
+
new_options = opts.merge(
|
313
|
+
:operation => :"EventsApi.get_event_profiles",
|
314
|
+
:header_params => header_params,
|
315
|
+
:query_params => query_params,
|
316
|
+
:form_params => form_params,
|
317
|
+
:body => post_body,
|
318
|
+
:auth_names => auth_names,
|
319
|
+
:return_type => return_type
|
320
|
+
)
|
321
|
+
|
322
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
323
|
+
if @api_client.config.debugging
|
324
|
+
@api_client.config.logger.debug "API called: EventsApi#get_event_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
325
|
+
end
|
326
|
+
return data, status_code, headers
|
327
|
+
end
|
328
|
+
|
329
|
+
# Get Event Relationships
|
330
|
+
# Get metrics or profile [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Profiles Read`
|
331
|
+
# @param id [String]
|
332
|
+
# @param related_resource [String]
|
333
|
+
# @param [Hash] opts the optional parameters
|
334
|
+
# @return [Hash<String, Object>]
|
335
|
+
def get_event_relationships(id, related_resource, opts = {})
|
336
|
+
data, _status_code, _headers = get_event_relationships_with_http_info(id, related_resource, opts)
|
337
|
+
data
|
338
|
+
end
|
339
|
+
|
340
|
+
# Get Event Relationships
|
341
|
+
# Get metrics or profile [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Profiles Read`
|
342
|
+
# @param id [String]
|
343
|
+
# @param related_resource [String]
|
344
|
+
# @param [Hash] opts the optional parameters
|
345
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
346
|
+
def get_event_relationships_with_http_info(id, related_resource, opts = {})
|
347
|
+
if @api_client.config.debugging
|
348
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_event_relationships ...'
|
349
|
+
end
|
350
|
+
# verify the required parameter 'id' is set
|
351
|
+
if @api_client.config.client_side_validation && id.nil?
|
352
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_event_relationships"
|
353
|
+
end
|
354
|
+
# verify the required parameter 'related_resource' is set
|
355
|
+
if @api_client.config.client_side_validation && related_resource.nil?
|
356
|
+
fail ArgumentError, "Missing the required parameter 'related_resource' when calling EventsApi.get_event_relationships"
|
357
|
+
end
|
358
|
+
# verify enum value
|
359
|
+
allowable_values = ["metrics", "profiles"]
|
360
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(related_resource)
|
361
|
+
fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}"
|
362
|
+
end
|
363
|
+
# resource path
|
364
|
+
local_var_path = '/api/events/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s))
|
365
|
+
|
366
|
+
# query parameters
|
367
|
+
query_params = opts[:query_params] || {}
|
368
|
+
|
369
|
+
# header parameters
|
370
|
+
header_params = opts[:header_params] || {}
|
371
|
+
# klaviyo api revision
|
372
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
373
|
+
# HTTP header 'Accept' (if needed)
|
374
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
375
|
+
|
376
|
+
# form parameters
|
377
|
+
form_params = opts[:form_params] || {}
|
378
|
+
|
379
|
+
# http body (model)
|
380
|
+
post_body = opts[:debug_body]
|
381
|
+
|
382
|
+
# return_type
|
383
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
384
|
+
|
385
|
+
# auth_names
|
386
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
387
|
+
|
388
|
+
new_options = opts.merge(
|
389
|
+
:operation => :"EventsApi.get_event_relationships",
|
390
|
+
:header_params => header_params,
|
391
|
+
:query_params => query_params,
|
392
|
+
:form_params => form_params,
|
393
|
+
:body => post_body,
|
394
|
+
:auth_names => auth_names,
|
395
|
+
:return_type => return_type
|
396
|
+
)
|
397
|
+
|
398
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
399
|
+
if @api_client.config.debugging
|
400
|
+
@api_client.config.logger.debug "API called: EventsApi#get_event_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
401
|
+
end
|
402
|
+
return data, status_code, headers
|
403
|
+
end
|
404
|
+
|
405
|
+
# Get Events
|
406
|
+
# Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` Use filters to narrow your results to specific metrics. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `metrics`, `profiles` Returns a maximum of 200 events per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read`
|
407
|
+
# @param [Hash] opts the optional parameters
|
408
|
+
# @option opts [Array<String>] :fields_event For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
409
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
410
|
+
# @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
411
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
412
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
413
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination
|
414
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
415
|
+
# @return [Hash<String, Object>]
|
416
|
+
def get_events(opts = {})
|
417
|
+
data, _status_code, _headers = get_events_with_http_info(opts)
|
418
|
+
data
|
419
|
+
end
|
420
|
+
|
421
|
+
# Get Events
|
422
|
+
# Get all events in an account Requests can be sorted by the following fields: `datetime`, `timestamp` Use filters to narrow your results to specific metrics. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `metrics`, `profiles` Returns a maximum of 200 events per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read`
|
423
|
+
# @param [Hash] opts the optional parameters
|
424
|
+
# @option opts [Array<String>] :fields_event For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
425
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
426
|
+
# @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
427
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`metric_id`: `equals`<br>`datetime`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`timestamp`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
428
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
429
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination
|
430
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
431
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
432
|
+
def get_events_with_http_info(opts = {})
|
433
|
+
if @api_client.config.debugging
|
434
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_events ...'
|
435
|
+
end
|
436
|
+
allowable_values = ["metric_id", "profile_id", "timestamp", "event_properties", "datetime", "uuid"]
|
437
|
+
if @api_client.config.client_side_validation && opts[:'fields_event'] && !opts[:'fields_event'].all? { |item| allowable_values.include?(item) }
|
438
|
+
fail ArgumentError, "invalid value for \"fields_event\", must include one of #{allowable_values}"
|
439
|
+
end
|
440
|
+
allowable_values = ["name", "created", "updated", "integration"]
|
441
|
+
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
442
|
+
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
443
|
+
end
|
444
|
+
allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"]
|
445
|
+
if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
|
446
|
+
fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
|
447
|
+
end
|
448
|
+
allowable_values = ["metrics", "profiles"]
|
449
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
450
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
451
|
+
end
|
452
|
+
allowable_values = ["datetime", "-datetime", "timestamp", "-timestamp"]
|
453
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
454
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
455
|
+
end
|
456
|
+
# resource path
|
457
|
+
local_var_path = '/api/events/'
|
458
|
+
|
459
|
+
# query parameters
|
460
|
+
query_params = opts[:query_params] || {}
|
461
|
+
query_params[:'fields[event]'] = @api_client.build_collection_param(opts[:'fields_event'], :csv) if !opts[:'fields_event'].nil?
|
462
|
+
query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
|
463
|
+
query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
|
464
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
465
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
466
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
467
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
468
|
+
|
469
|
+
# header parameters
|
470
|
+
header_params = opts[:header_params] || {}
|
471
|
+
# klaviyo api revision
|
472
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
473
|
+
# HTTP header 'Accept' (if needed)
|
474
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
475
|
+
|
476
|
+
# form parameters
|
477
|
+
form_params = opts[:form_params] || {}
|
478
|
+
|
479
|
+
# http body (model)
|
480
|
+
post_body = opts[:debug_body]
|
481
|
+
|
482
|
+
# return_type
|
483
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
484
|
+
|
485
|
+
# auth_names
|
486
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
487
|
+
|
488
|
+
new_options = opts.merge(
|
489
|
+
:operation => :"EventsApi.get_events",
|
490
|
+
:header_params => header_params,
|
491
|
+
:query_params => query_params,
|
492
|
+
:form_params => form_params,
|
493
|
+
:body => post_body,
|
494
|
+
:auth_names => auth_names,
|
495
|
+
:return_type => return_type
|
496
|
+
)
|
497
|
+
|
498
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
499
|
+
if @api_client.config.debugging
|
500
|
+
@api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
501
|
+
end
|
502
|
+
return data, status_code, headers
|
503
|
+
end
|
504
|
+
end
|
505
|
+
end
|