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,1009 @@
|
|
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 FlowsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get Flow
|
23
|
+
# Get a flow with the given flow 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: `flow-actions`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
24
|
+
# @param id [String]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
27
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
28
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
29
|
+
# @return [Hash<String, Object>]
|
30
|
+
def get_flow(id, opts = {})
|
31
|
+
data, _status_code, _headers = get_flow_with_http_info(id, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Get Flow
|
36
|
+
# Get a flow with the given flow 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: `flow-actions`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
37
|
+
# @param id [String]
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
40
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
41
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
42
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
43
|
+
def get_flow_with_http_info(id, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'id' is set
|
48
|
+
if @api_client.config.client_side_validation && id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow"
|
50
|
+
end
|
51
|
+
allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"]
|
52
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) }
|
53
|
+
fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}"
|
54
|
+
end
|
55
|
+
allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
|
56
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
57
|
+
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
58
|
+
end
|
59
|
+
allowable_values = ["flow-actions"]
|
60
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
61
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
62
|
+
end
|
63
|
+
# resource path
|
64
|
+
local_var_path = '/api/flows/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
65
|
+
|
66
|
+
# query parameters
|
67
|
+
query_params = opts[:query_params] || {}
|
68
|
+
query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil?
|
69
|
+
query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
|
70
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
71
|
+
|
72
|
+
# header parameters
|
73
|
+
header_params = opts[:header_params] || {}
|
74
|
+
# klaviyo api revision
|
75
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
76
|
+
# HTTP header 'Accept' (if needed)
|
77
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
78
|
+
|
79
|
+
# form parameters
|
80
|
+
form_params = opts[:form_params] || {}
|
81
|
+
|
82
|
+
# http body (model)
|
83
|
+
post_body = opts[:debug_body]
|
84
|
+
|
85
|
+
# return_type
|
86
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
87
|
+
|
88
|
+
# auth_names
|
89
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
90
|
+
|
91
|
+
new_options = opts.merge(
|
92
|
+
:operation => :"FlowsApi.get_flow",
|
93
|
+
:header_params => header_params,
|
94
|
+
:query_params => query_params,
|
95
|
+
:form_params => form_params,
|
96
|
+
:body => post_body,
|
97
|
+
:auth_names => auth_names,
|
98
|
+
:return_type => return_type
|
99
|
+
)
|
100
|
+
|
101
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
104
|
+
end
|
105
|
+
return data, status_code, headers
|
106
|
+
end
|
107
|
+
|
108
|
+
# Get Flow Action
|
109
|
+
# Get a flow action from a flow with the given flow action ID. Include parameters can be provided to get the following related resource data: `flows`, `flow-messages`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
110
|
+
# @param id [String]
|
111
|
+
# @param [Hash] opts the optional parameters
|
112
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
113
|
+
# @option opts [Array<String>] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
114
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
115
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
116
|
+
# @return [Hash<String, Object>]
|
117
|
+
def get_flow_action(id, opts = {})
|
118
|
+
data, _status_code, _headers = get_flow_action_with_http_info(id, opts)
|
119
|
+
data
|
120
|
+
end
|
121
|
+
|
122
|
+
# Get Flow Action
|
123
|
+
# Get a flow action from a flow with the given flow action ID. Include parameters can be provided to get the following related resource data: `flows`, `flow-messages`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
124
|
+
# @param id [String]
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
127
|
+
# @option opts [Array<String>] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
128
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
129
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
130
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
131
|
+
def get_flow_action_with_http_info(id, opts = {})
|
132
|
+
if @api_client.config.debugging
|
133
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action ...'
|
134
|
+
end
|
135
|
+
# verify the required parameter 'id' is set
|
136
|
+
if @api_client.config.client_side_validation && id.nil?
|
137
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action"
|
138
|
+
end
|
139
|
+
allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"]
|
140
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) }
|
141
|
+
fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}"
|
142
|
+
end
|
143
|
+
allowable_values = ["name", "channel", "content", "created", "updated"]
|
144
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) }
|
145
|
+
fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}"
|
146
|
+
end
|
147
|
+
allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
|
148
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
149
|
+
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
150
|
+
end
|
151
|
+
allowable_values = ["flow-messages", "flows"]
|
152
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
153
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
154
|
+
end
|
155
|
+
# resource path
|
156
|
+
local_var_path = '/api/flow-actions/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
157
|
+
|
158
|
+
# query parameters
|
159
|
+
query_params = opts[:query_params] || {}
|
160
|
+
query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil?
|
161
|
+
query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil?
|
162
|
+
query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
|
163
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
164
|
+
|
165
|
+
# header parameters
|
166
|
+
header_params = opts[:header_params] || {}
|
167
|
+
# klaviyo api revision
|
168
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
169
|
+
# HTTP header 'Accept' (if needed)
|
170
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
171
|
+
|
172
|
+
# form parameters
|
173
|
+
form_params = opts[:form_params] || {}
|
174
|
+
|
175
|
+
# http body (model)
|
176
|
+
post_body = opts[:debug_body]
|
177
|
+
|
178
|
+
# return_type
|
179
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
180
|
+
|
181
|
+
# auth_names
|
182
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
183
|
+
|
184
|
+
new_options = opts.merge(
|
185
|
+
:operation => :"FlowsApi.get_flow_action",
|
186
|
+
:header_params => header_params,
|
187
|
+
:query_params => query_params,
|
188
|
+
:form_params => form_params,
|
189
|
+
:body => post_body,
|
190
|
+
:auth_names => auth_names,
|
191
|
+
:return_type => return_type
|
192
|
+
)
|
193
|
+
|
194
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
195
|
+
if @api_client.config.debugging
|
196
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
197
|
+
end
|
198
|
+
return data, status_code, headers
|
199
|
+
end
|
200
|
+
|
201
|
+
# Get Flow For Flow Action
|
202
|
+
# Get the flow associated with the given action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
203
|
+
# @param action_id [String]
|
204
|
+
# @param [Hash] opts the optional parameters
|
205
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
206
|
+
# @return [Hash<String, Object>]
|
207
|
+
def get_flow_action_flow(action_id, opts = {})
|
208
|
+
data, _status_code, _headers = get_flow_action_flow_with_http_info(action_id, opts)
|
209
|
+
data
|
210
|
+
end
|
211
|
+
|
212
|
+
# Get Flow For Flow Action
|
213
|
+
# Get the flow associated with the given action ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
214
|
+
# @param action_id [String]
|
215
|
+
# @param [Hash] opts the optional parameters
|
216
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
217
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
218
|
+
def get_flow_action_flow_with_http_info(action_id, opts = {})
|
219
|
+
if @api_client.config.debugging
|
220
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_flow ...'
|
221
|
+
end
|
222
|
+
# verify the required parameter 'action_id' is set
|
223
|
+
if @api_client.config.client_side_validation && action_id.nil?
|
224
|
+
fail ArgumentError, "Missing the required parameter 'action_id' when calling FlowsApi.get_flow_action_flow"
|
225
|
+
end
|
226
|
+
allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
|
227
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
228
|
+
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
229
|
+
end
|
230
|
+
# resource path
|
231
|
+
local_var_path = '/api/flow-actions/{action_id}/flow/'.sub('{' + 'action_id' + '}', CGI.escape(action_id.to_s))
|
232
|
+
|
233
|
+
# query parameters
|
234
|
+
query_params = opts[:query_params] || {}
|
235
|
+
query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
|
236
|
+
|
237
|
+
# header parameters
|
238
|
+
header_params = opts[:header_params] || {}
|
239
|
+
# klaviyo api revision
|
240
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
241
|
+
# HTTP header 'Accept' (if needed)
|
242
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
243
|
+
|
244
|
+
# form parameters
|
245
|
+
form_params = opts[:form_params] || {}
|
246
|
+
|
247
|
+
# http body (model)
|
248
|
+
post_body = opts[:debug_body]
|
249
|
+
|
250
|
+
# return_type
|
251
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
252
|
+
|
253
|
+
# auth_names
|
254
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
255
|
+
|
256
|
+
new_options = opts.merge(
|
257
|
+
:operation => :"FlowsApi.get_flow_action_flow",
|
258
|
+
:header_params => header_params,
|
259
|
+
:query_params => query_params,
|
260
|
+
:form_params => form_params,
|
261
|
+
:body => post_body,
|
262
|
+
:auth_names => auth_names,
|
263
|
+
:return_type => return_type
|
264
|
+
)
|
265
|
+
|
266
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
267
|
+
if @api_client.config.debugging
|
268
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_action_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
269
|
+
end
|
270
|
+
return data, status_code, headers
|
271
|
+
end
|
272
|
+
|
273
|
+
# Get Messages For Flow Action
|
274
|
+
# Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
275
|
+
# @param action_id [String]
|
276
|
+
# @param [Hash] opts the optional parameters
|
277
|
+
# @option opts [Array<String>] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
278
|
+
# @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>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
279
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
280
|
+
# @return [Hash<String, Object>]
|
281
|
+
def get_flow_action_messages(action_id, opts = {})
|
282
|
+
data, _status_code, _headers = get_flow_action_messages_with_http_info(action_id, opts)
|
283
|
+
data
|
284
|
+
end
|
285
|
+
|
286
|
+
# Get Messages For Flow Action
|
287
|
+
# Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
288
|
+
# @param action_id [String]
|
289
|
+
# @param [Hash] opts the optional parameters
|
290
|
+
# @option opts [Array<String>] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
291
|
+
# @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>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
292
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
293
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
294
|
+
def get_flow_action_messages_with_http_info(action_id, opts = {})
|
295
|
+
if @api_client.config.debugging
|
296
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_messages ...'
|
297
|
+
end
|
298
|
+
# verify the required parameter 'action_id' is set
|
299
|
+
if @api_client.config.client_side_validation && action_id.nil?
|
300
|
+
fail ArgumentError, "Missing the required parameter 'action_id' when calling FlowsApi.get_flow_action_messages"
|
301
|
+
end
|
302
|
+
allowable_values = ["name", "channel", "content", "created", "updated"]
|
303
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) }
|
304
|
+
fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}"
|
305
|
+
end
|
306
|
+
allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"]
|
307
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
308
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
309
|
+
end
|
310
|
+
# resource path
|
311
|
+
local_var_path = '/api/flow-actions/{action_id}/flow-messages/'.sub('{' + 'action_id' + '}', CGI.escape(action_id.to_s))
|
312
|
+
|
313
|
+
# query parameters
|
314
|
+
query_params = opts[:query_params] || {}
|
315
|
+
query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil?
|
316
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
317
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
318
|
+
|
319
|
+
# header parameters
|
320
|
+
header_params = opts[:header_params] || {}
|
321
|
+
# klaviyo api revision
|
322
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
323
|
+
# HTTP header 'Accept' (if needed)
|
324
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
325
|
+
|
326
|
+
# form parameters
|
327
|
+
form_params = opts[:form_params] || {}
|
328
|
+
|
329
|
+
# http body (model)
|
330
|
+
post_body = opts[:debug_body]
|
331
|
+
|
332
|
+
# return_type
|
333
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
334
|
+
|
335
|
+
# auth_names
|
336
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
337
|
+
|
338
|
+
new_options = opts.merge(
|
339
|
+
:operation => :"FlowsApi.get_flow_action_messages",
|
340
|
+
:header_params => header_params,
|
341
|
+
:query_params => query_params,
|
342
|
+
:form_params => form_params,
|
343
|
+
:body => post_body,
|
344
|
+
:auth_names => auth_names,
|
345
|
+
:return_type => return_type
|
346
|
+
)
|
347
|
+
|
348
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
349
|
+
if @api_client.config.debugging
|
350
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_action_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
351
|
+
end
|
352
|
+
return data, status_code, headers
|
353
|
+
end
|
354
|
+
|
355
|
+
# Get Flow Action Relationships
|
356
|
+
# Get all [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for flow messages associated with the given flow action ID. Flow message relationships can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow message relationships per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
357
|
+
# @param id [String]
|
358
|
+
# @param related_resource [String]
|
359
|
+
# @param [Hash] opts the optional parameters
|
360
|
+
# @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>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
361
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
362
|
+
# @return [Hash<String, Object>]
|
363
|
+
def get_flow_action_relationships(id, related_resource, opts = {})
|
364
|
+
data, _status_code, _headers = get_flow_action_relationships_with_http_info(id, related_resource, opts)
|
365
|
+
data
|
366
|
+
end
|
367
|
+
|
368
|
+
# Get Flow Action Relationships
|
369
|
+
# Get all [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for flow messages associated with the given flow action ID. Flow message relationships can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow message relationships per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
370
|
+
# @param id [String]
|
371
|
+
# @param related_resource [String]
|
372
|
+
# @param [Hash] opts the optional parameters
|
373
|
+
# @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>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
374
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
375
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
376
|
+
def get_flow_action_relationships_with_http_info(id, related_resource, opts = {})
|
377
|
+
if @api_client.config.debugging
|
378
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_action_relationships ...'
|
379
|
+
end
|
380
|
+
# verify the required parameter 'id' is set
|
381
|
+
if @api_client.config.client_side_validation && id.nil?
|
382
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_action_relationships"
|
383
|
+
end
|
384
|
+
# verify the required parameter 'related_resource' is set
|
385
|
+
if @api_client.config.client_side_validation && related_resource.nil?
|
386
|
+
fail ArgumentError, "Missing the required parameter 'related_resource' when calling FlowsApi.get_flow_action_relationships"
|
387
|
+
end
|
388
|
+
# verify enum value
|
389
|
+
allowable_values = ["flow", "flow-messages"]
|
390
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(related_resource)
|
391
|
+
fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}"
|
392
|
+
end
|
393
|
+
allowable_values = ["created", "-created", "id", "-id", "name", "-name", "updated", "-updated"]
|
394
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
395
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
396
|
+
end
|
397
|
+
# resource path
|
398
|
+
local_var_path = '/api/flow-actions/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s))
|
399
|
+
|
400
|
+
# query parameters
|
401
|
+
query_params = opts[:query_params] || {}
|
402
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
403
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
404
|
+
|
405
|
+
# header parameters
|
406
|
+
header_params = opts[:header_params] || {}
|
407
|
+
# klaviyo api revision
|
408
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
409
|
+
# HTTP header 'Accept' (if needed)
|
410
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
411
|
+
|
412
|
+
# form parameters
|
413
|
+
form_params = opts[:form_params] || {}
|
414
|
+
|
415
|
+
# http body (model)
|
416
|
+
post_body = opts[:debug_body]
|
417
|
+
|
418
|
+
# return_type
|
419
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
420
|
+
|
421
|
+
# auth_names
|
422
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
423
|
+
|
424
|
+
new_options = opts.merge(
|
425
|
+
:operation => :"FlowsApi.get_flow_action_relationships",
|
426
|
+
:header_params => header_params,
|
427
|
+
:query_params => query_params,
|
428
|
+
:form_params => form_params,
|
429
|
+
:body => post_body,
|
430
|
+
:auth_names => auth_names,
|
431
|
+
:return_type => return_type
|
432
|
+
)
|
433
|
+
|
434
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
435
|
+
if @api_client.config.debugging
|
436
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_action_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
437
|
+
end
|
438
|
+
return data, status_code, headers
|
439
|
+
end
|
440
|
+
|
441
|
+
# Get Flow Actions For Flow
|
442
|
+
# Get all flow actions associated with the given flow ID. Flow actions can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated`, `action_type` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
443
|
+
# @param flow_id [String]
|
444
|
+
# @param [Hash] opts the optional parameters
|
445
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
446
|
+
# @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>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
447
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
448
|
+
# @return [Hash<String, Object>]
|
449
|
+
def get_flow_flow_actions(flow_id, opts = {})
|
450
|
+
data, _status_code, _headers = get_flow_flow_actions_with_http_info(flow_id, opts)
|
451
|
+
data
|
452
|
+
end
|
453
|
+
|
454
|
+
# Get Flow Actions For Flow
|
455
|
+
# Get all flow actions associated with the given flow ID. Flow actions can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated`, `action_type` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
456
|
+
# @param flow_id [String]
|
457
|
+
# @param [Hash] opts the optional parameters
|
458
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
459
|
+
# @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>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
460
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
461
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
462
|
+
def get_flow_flow_actions_with_http_info(flow_id, opts = {})
|
463
|
+
if @api_client.config.debugging
|
464
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_flow_actions ...'
|
465
|
+
end
|
466
|
+
# verify the required parameter 'flow_id' is set
|
467
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
468
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling FlowsApi.get_flow_flow_actions"
|
469
|
+
end
|
470
|
+
allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"]
|
471
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) }
|
472
|
+
fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}"
|
473
|
+
end
|
474
|
+
allowable_values = ["action_type", "-action_type", "created", "-created", "id", "-id", "status", "-status", "updated", "-updated"]
|
475
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
476
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
477
|
+
end
|
478
|
+
# resource path
|
479
|
+
local_var_path = '/api/flows/{flow_id}/flow-actions/'.sub('{' + 'flow_id' + '}', CGI.escape(flow_id.to_s))
|
480
|
+
|
481
|
+
# query parameters
|
482
|
+
query_params = opts[:query_params] || {}
|
483
|
+
query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil?
|
484
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
485
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
486
|
+
|
487
|
+
# header parameters
|
488
|
+
header_params = opts[:header_params] || {}
|
489
|
+
# klaviyo api revision
|
490
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
491
|
+
# HTTP header 'Accept' (if needed)
|
492
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
493
|
+
|
494
|
+
# form parameters
|
495
|
+
form_params = opts[:form_params] || {}
|
496
|
+
|
497
|
+
# http body (model)
|
498
|
+
post_body = opts[:debug_body]
|
499
|
+
|
500
|
+
# return_type
|
501
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
502
|
+
|
503
|
+
# auth_names
|
504
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
505
|
+
|
506
|
+
new_options = opts.merge(
|
507
|
+
:operation => :"FlowsApi.get_flow_flow_actions",
|
508
|
+
:header_params => header_params,
|
509
|
+
:query_params => query_params,
|
510
|
+
:form_params => form_params,
|
511
|
+
:body => post_body,
|
512
|
+
:auth_names => auth_names,
|
513
|
+
:return_type => return_type
|
514
|
+
)
|
515
|
+
|
516
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
517
|
+
if @api_client.config.debugging
|
518
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_flow_actions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
519
|
+
end
|
520
|
+
return data, status_code, headers
|
521
|
+
end
|
522
|
+
|
523
|
+
# Get Flow Message
|
524
|
+
# Get the flow message of a flow with the given message 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: 'flow-actions'<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
525
|
+
# @param id [String]
|
526
|
+
# @param [Hash] opts the optional parameters
|
527
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
528
|
+
# @option opts [Array<String>] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
529
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
530
|
+
# @return [Hash<String, Object>]
|
531
|
+
def get_flow_message(id, opts = {})
|
532
|
+
data, _status_code, _headers = get_flow_message_with_http_info(id, opts)
|
533
|
+
data
|
534
|
+
end
|
535
|
+
|
536
|
+
# Get Flow Message
|
537
|
+
# Get the flow message of a flow with the given message 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: 'flow-actions'<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
538
|
+
# @param id [String]
|
539
|
+
# @param [Hash] opts the optional parameters
|
540
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
541
|
+
# @option opts [Array<String>] :fields_flow_message For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
542
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
543
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
544
|
+
def get_flow_message_with_http_info(id, opts = {})
|
545
|
+
if @api_client.config.debugging
|
546
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_message ...'
|
547
|
+
end
|
548
|
+
# verify the required parameter 'id' is set
|
549
|
+
if @api_client.config.client_side_validation && id.nil?
|
550
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message"
|
551
|
+
end
|
552
|
+
allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"]
|
553
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) }
|
554
|
+
fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}"
|
555
|
+
end
|
556
|
+
allowable_values = ["name", "channel", "content", "created", "updated"]
|
557
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_message'] && !opts[:'fields_flow_message'].all? { |item| allowable_values.include?(item) }
|
558
|
+
fail ArgumentError, "invalid value for \"fields_flow_message\", must include one of #{allowable_values}"
|
559
|
+
end
|
560
|
+
allowable_values = ["flow-action"]
|
561
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
562
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
563
|
+
end
|
564
|
+
# resource path
|
565
|
+
local_var_path = '/api/flow-messages/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
566
|
+
|
567
|
+
# query parameters
|
568
|
+
query_params = opts[:query_params] || {}
|
569
|
+
query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil?
|
570
|
+
query_params[:'fields[flow-message]'] = @api_client.build_collection_param(opts[:'fields_flow_message'], :csv) if !opts[:'fields_flow_message'].nil?
|
571
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
572
|
+
|
573
|
+
# header parameters
|
574
|
+
header_params = opts[:header_params] || {}
|
575
|
+
# klaviyo api revision
|
576
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
577
|
+
# HTTP header 'Accept' (if needed)
|
578
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
579
|
+
|
580
|
+
# form parameters
|
581
|
+
form_params = opts[:form_params] || {}
|
582
|
+
|
583
|
+
# http body (model)
|
584
|
+
post_body = opts[:debug_body]
|
585
|
+
|
586
|
+
# return_type
|
587
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
588
|
+
|
589
|
+
# auth_names
|
590
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
591
|
+
|
592
|
+
new_options = opts.merge(
|
593
|
+
:operation => :"FlowsApi.get_flow_message",
|
594
|
+
:header_params => header_params,
|
595
|
+
:query_params => query_params,
|
596
|
+
:form_params => form_params,
|
597
|
+
:body => post_body,
|
598
|
+
:auth_names => auth_names,
|
599
|
+
:return_type => return_type
|
600
|
+
)
|
601
|
+
|
602
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
603
|
+
if @api_client.config.debugging
|
604
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
605
|
+
end
|
606
|
+
return data, status_code, headers
|
607
|
+
end
|
608
|
+
|
609
|
+
# Get Flow Action For Message
|
610
|
+
# Get the flow action for a flow message with the given message ID. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
611
|
+
# @param message_id [String]
|
612
|
+
# @param [Hash] opts the optional parameters
|
613
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
614
|
+
# @return [Hash<String, Object>]
|
615
|
+
def get_flow_message_action(message_id, opts = {})
|
616
|
+
data, _status_code, _headers = get_flow_message_action_with_http_info(message_id, opts)
|
617
|
+
data
|
618
|
+
end
|
619
|
+
|
620
|
+
# Get Flow Action For Message
|
621
|
+
# Get the flow action for a flow message with the given message ID. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
622
|
+
# @param message_id [String]
|
623
|
+
# @param [Hash] opts the optional parameters
|
624
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
625
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
626
|
+
def get_flow_message_action_with_http_info(message_id, opts = {})
|
627
|
+
if @api_client.config.debugging
|
628
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_message_action ...'
|
629
|
+
end
|
630
|
+
# verify the required parameter 'message_id' is set
|
631
|
+
if @api_client.config.client_side_validation && message_id.nil?
|
632
|
+
fail ArgumentError, "Missing the required parameter 'message_id' when calling FlowsApi.get_flow_message_action"
|
633
|
+
end
|
634
|
+
allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"]
|
635
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) }
|
636
|
+
fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}"
|
637
|
+
end
|
638
|
+
# resource path
|
639
|
+
local_var_path = '/api/flow-messages/{message_id}/flow-action/'.sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s))
|
640
|
+
|
641
|
+
# query parameters
|
642
|
+
query_params = opts[:query_params] || {}
|
643
|
+
query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil?
|
644
|
+
|
645
|
+
# header parameters
|
646
|
+
header_params = opts[:header_params] || {}
|
647
|
+
# klaviyo api revision
|
648
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
649
|
+
# HTTP header 'Accept' (if needed)
|
650
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
651
|
+
|
652
|
+
# form parameters
|
653
|
+
form_params = opts[:form_params] || {}
|
654
|
+
|
655
|
+
# http body (model)
|
656
|
+
post_body = opts[:debug_body]
|
657
|
+
|
658
|
+
# return_type
|
659
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
660
|
+
|
661
|
+
# auth_names
|
662
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
663
|
+
|
664
|
+
new_options = opts.merge(
|
665
|
+
:operation => :"FlowsApi.get_flow_message_action",
|
666
|
+
:header_params => header_params,
|
667
|
+
:query_params => query_params,
|
668
|
+
:form_params => form_params,
|
669
|
+
:body => post_body,
|
670
|
+
:auth_names => auth_names,
|
671
|
+
:return_type => return_type
|
672
|
+
)
|
673
|
+
|
674
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
675
|
+
if @api_client.config.debugging
|
676
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_message_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
677
|
+
end
|
678
|
+
return data, status_code, headers
|
679
|
+
end
|
680
|
+
|
681
|
+
# Get Flow Message Relationships
|
682
|
+
# Get the [relationship](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
683
|
+
# @param id [String]
|
684
|
+
# @param related_resource [String]
|
685
|
+
# @param [Hash] opts the optional parameters
|
686
|
+
# @return [Hash<String, Object>]
|
687
|
+
def get_flow_message_relationships(id, related_resource, opts = {})
|
688
|
+
data, _status_code, _headers = get_flow_message_relationships_with_http_info(id, related_resource, opts)
|
689
|
+
data
|
690
|
+
end
|
691
|
+
|
692
|
+
# Get Flow Message Relationships
|
693
|
+
# Get the [relationship](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
694
|
+
# @param id [String]
|
695
|
+
# @param related_resource [String]
|
696
|
+
# @param [Hash] opts the optional parameters
|
697
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
698
|
+
def get_flow_message_relationships_with_http_info(id, related_resource, opts = {})
|
699
|
+
if @api_client.config.debugging
|
700
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_message_relationships ...'
|
701
|
+
end
|
702
|
+
# verify the required parameter 'id' is set
|
703
|
+
if @api_client.config.client_side_validation && id.nil?
|
704
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_message_relationships"
|
705
|
+
end
|
706
|
+
# verify the required parameter 'related_resource' is set
|
707
|
+
if @api_client.config.client_side_validation && related_resource.nil?
|
708
|
+
fail ArgumentError, "Missing the required parameter 'related_resource' when calling FlowsApi.get_flow_message_relationships"
|
709
|
+
end
|
710
|
+
# verify enum value
|
711
|
+
allowable_values = ["flow-action"]
|
712
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(related_resource)
|
713
|
+
fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}"
|
714
|
+
end
|
715
|
+
# resource path
|
716
|
+
local_var_path = '/api/flow-messages/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s))
|
717
|
+
|
718
|
+
# query parameters
|
719
|
+
query_params = opts[:query_params] || {}
|
720
|
+
|
721
|
+
# header parameters
|
722
|
+
header_params = opts[:header_params] || {}
|
723
|
+
# klaviyo api revision
|
724
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
725
|
+
# HTTP header 'Accept' (if needed)
|
726
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
727
|
+
|
728
|
+
# form parameters
|
729
|
+
form_params = opts[:form_params] || {}
|
730
|
+
|
731
|
+
# http body (model)
|
732
|
+
post_body = opts[:debug_body]
|
733
|
+
|
734
|
+
# return_type
|
735
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
736
|
+
|
737
|
+
# auth_names
|
738
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
739
|
+
|
740
|
+
new_options = opts.merge(
|
741
|
+
:operation => :"FlowsApi.get_flow_message_relationships",
|
742
|
+
:header_params => header_params,
|
743
|
+
:query_params => query_params,
|
744
|
+
:form_params => form_params,
|
745
|
+
:body => post_body,
|
746
|
+
:auth_names => auth_names,
|
747
|
+
:return_type => return_type
|
748
|
+
)
|
749
|
+
|
750
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
751
|
+
if @api_client.config.debugging
|
752
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_message_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
753
|
+
end
|
754
|
+
return data, status_code, headers
|
755
|
+
end
|
756
|
+
|
757
|
+
# Get Flow Relationships
|
758
|
+
# Get all [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for flow actions associated with the given flow ID. Flow action relationships can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow action relationships per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination)<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
759
|
+
# @param id [String]
|
760
|
+
# @param related_resource [String]
|
761
|
+
# @param [Hash] opts the optional parameters
|
762
|
+
# @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>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
763
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
764
|
+
# @return [Hash<String, Object>]
|
765
|
+
def get_flow_relationships(id, related_resource, opts = {})
|
766
|
+
data, _status_code, _headers = get_flow_relationships_with_http_info(id, related_resource, opts)
|
767
|
+
data
|
768
|
+
end
|
769
|
+
|
770
|
+
# Get Flow Relationships
|
771
|
+
# Get all [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for flow actions associated with the given flow ID. Flow action relationships can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated` Use filters to narrow your results. Returns a maximum of 50 flow action relationships per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination)<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
772
|
+
# @param id [String]
|
773
|
+
# @param related_resource [String]
|
774
|
+
# @param [Hash] opts the optional parameters
|
775
|
+
# @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>`action_type`: `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
776
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
777
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
778
|
+
def get_flow_relationships_with_http_info(id, related_resource, opts = {})
|
779
|
+
if @api_client.config.debugging
|
780
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flow_relationships ...'
|
781
|
+
end
|
782
|
+
# verify the required parameter 'id' is set
|
783
|
+
if @api_client.config.client_side_validation && id.nil?
|
784
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.get_flow_relationships"
|
785
|
+
end
|
786
|
+
# verify the required parameter 'related_resource' is set
|
787
|
+
if @api_client.config.client_side_validation && related_resource.nil?
|
788
|
+
fail ArgumentError, "Missing the required parameter 'related_resource' when calling FlowsApi.get_flow_relationships"
|
789
|
+
end
|
790
|
+
# verify enum value
|
791
|
+
allowable_values = ["flow-actions"]
|
792
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(related_resource)
|
793
|
+
fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}"
|
794
|
+
end
|
795
|
+
allowable_values = ["created", "-created", "id", "-id", "status", "-status", "updated", "-updated"]
|
796
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
797
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
798
|
+
end
|
799
|
+
# resource path
|
800
|
+
local_var_path = '/api/flows/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s))
|
801
|
+
|
802
|
+
# query parameters
|
803
|
+
query_params = opts[:query_params] || {}
|
804
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
805
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
806
|
+
|
807
|
+
# header parameters
|
808
|
+
header_params = opts[:header_params] || {}
|
809
|
+
# klaviyo api revision
|
810
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
811
|
+
# HTTP header 'Accept' (if needed)
|
812
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
813
|
+
|
814
|
+
# form parameters
|
815
|
+
form_params = opts[:form_params] || {}
|
816
|
+
|
817
|
+
# http body (model)
|
818
|
+
post_body = opts[:debug_body]
|
819
|
+
|
820
|
+
# return_type
|
821
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
822
|
+
|
823
|
+
# auth_names
|
824
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
825
|
+
|
826
|
+
new_options = opts.merge(
|
827
|
+
:operation => :"FlowsApi.get_flow_relationships",
|
828
|
+
:header_params => header_params,
|
829
|
+
:query_params => query_params,
|
830
|
+
:form_params => form_params,
|
831
|
+
:body => post_body,
|
832
|
+
:auth_names => auth_names,
|
833
|
+
:return_type => return_type
|
834
|
+
)
|
835
|
+
|
836
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
837
|
+
if @api_client.config.debugging
|
838
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flow_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
839
|
+
end
|
840
|
+
return data, status_code, headers
|
841
|
+
end
|
842
|
+
|
843
|
+
# Get Flows
|
844
|
+
# Get all flows in an account. Flows can be sorted by the following fields, in ascending and descending order: `id`, `name`, `status`, `trigger_type`, `created`, `updated` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `flow-actions` Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination)<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
845
|
+
# @param [Hash] opts the optional parameters
|
846
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
847
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
848
|
+
# @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>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals`
|
849
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
850
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
851
|
+
# @return [Hash<String, Object>]
|
852
|
+
def get_flows(opts = {})
|
853
|
+
data, _status_code, _headers = get_flows_with_http_info(opts)
|
854
|
+
data
|
855
|
+
end
|
856
|
+
|
857
|
+
# Get Flows
|
858
|
+
# Get all flows in an account. Flows can be sorted by the following fields, in ascending and descending order: `id`, `name`, `status`, `trigger_type`, `created`, `updated` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `flow-actions` Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination)<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read`
|
859
|
+
# @param [Hash] opts the optional parameters
|
860
|
+
# @option opts [Array<String>] :fields_flow_action For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
861
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
|
862
|
+
# @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>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals`
|
863
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
|
864
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
|
865
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
866
|
+
def get_flows_with_http_info(opts = {})
|
867
|
+
if @api_client.config.debugging
|
868
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.get_flows ...'
|
869
|
+
end
|
870
|
+
allowable_values = ["action_type", "status", "created", "updated", "settings", "tracking_options", "send_options", "send_options.use_smart_sending", "send_options.is_transactional", "render_options", "render_options.shorten_links", "render_options.add_org_prefix", "render_options.add_info_link", "render_options.add_opt_out_language"]
|
871
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow_action'] && !opts[:'fields_flow_action'].all? { |item| allowable_values.include?(item) }
|
872
|
+
fail ArgumentError, "invalid value for \"fields_flow_action\", must include one of #{allowable_values}"
|
873
|
+
end
|
874
|
+
allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
|
875
|
+
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
876
|
+
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
877
|
+
end
|
878
|
+
allowable_values = ["flow-actions"]
|
879
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
880
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
881
|
+
end
|
882
|
+
allowable_values = ["created", "-created", "id", "-id", "name", "-name", "status", "-status", "trigger_type", "-trigger_type", "updated", "-updated"]
|
883
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
884
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
885
|
+
end
|
886
|
+
# resource path
|
887
|
+
local_var_path = '/api/flows/'
|
888
|
+
|
889
|
+
# query parameters
|
890
|
+
query_params = opts[:query_params] || {}
|
891
|
+
query_params[:'fields[flow-action]'] = @api_client.build_collection_param(opts[:'fields_flow_action'], :csv) if !opts[:'fields_flow_action'].nil?
|
892
|
+
query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
|
893
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
894
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
895
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
896
|
+
|
897
|
+
# header parameters
|
898
|
+
header_params = opts[:header_params] || {}
|
899
|
+
# klaviyo api revision
|
900
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
901
|
+
# HTTP header 'Accept' (if needed)
|
902
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
903
|
+
|
904
|
+
# form parameters
|
905
|
+
form_params = opts[:form_params] || {}
|
906
|
+
|
907
|
+
# http body (model)
|
908
|
+
post_body = opts[:debug_body]
|
909
|
+
|
910
|
+
# return_type
|
911
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
912
|
+
|
913
|
+
# auth_names
|
914
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
915
|
+
|
916
|
+
new_options = opts.merge(
|
917
|
+
:operation => :"FlowsApi.get_flows",
|
918
|
+
:header_params => header_params,
|
919
|
+
:query_params => query_params,
|
920
|
+
:form_params => form_params,
|
921
|
+
:body => post_body,
|
922
|
+
:auth_names => auth_names,
|
923
|
+
:return_type => return_type
|
924
|
+
)
|
925
|
+
|
926
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
927
|
+
if @api_client.config.debugging
|
928
|
+
@api_client.config.logger.debug "API called: FlowsApi#get_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
929
|
+
end
|
930
|
+
return data, status_code, headers
|
931
|
+
end
|
932
|
+
|
933
|
+
# Update Flow Status
|
934
|
+
# Update the status of a flow with the given flow ID, and all actions in that flow.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Write`
|
935
|
+
# @param id [String]
|
936
|
+
# @param flow_update_query [FlowUpdateQuery]
|
937
|
+
# @param [Hash] opts the optional parameters
|
938
|
+
# @return [Hash<String, Object>]
|
939
|
+
def update_flow(id, flow_update_query, opts = {})
|
940
|
+
data, _status_code, _headers = update_flow_with_http_info(id, flow_update_query, opts)
|
941
|
+
data
|
942
|
+
end
|
943
|
+
|
944
|
+
# Update Flow Status
|
945
|
+
# Update the status of a flow with the given flow ID, and all actions in that flow.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Write`
|
946
|
+
# @param id [String]
|
947
|
+
# @param flow_update_query [FlowUpdateQuery]
|
948
|
+
# @param [Hash] opts the optional parameters
|
949
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
950
|
+
def update_flow_with_http_info(id, flow_update_query, opts = {})
|
951
|
+
if @api_client.config.debugging
|
952
|
+
@api_client.config.logger.debug 'Calling API: FlowsApi.update_flow ...'
|
953
|
+
end
|
954
|
+
# verify the required parameter 'id' is set
|
955
|
+
if @api_client.config.client_side_validation && id.nil?
|
956
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlowsApi.update_flow"
|
957
|
+
end
|
958
|
+
# verify the required parameter 'flow_update_query' is set
|
959
|
+
if @api_client.config.client_side_validation && flow_update_query.nil?
|
960
|
+
fail ArgumentError, "Missing the required parameter 'flow_update_query' when calling FlowsApi.update_flow"
|
961
|
+
end
|
962
|
+
# resource path
|
963
|
+
local_var_path = '/api/flows/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
964
|
+
|
965
|
+
# query parameters
|
966
|
+
query_params = opts[:query_params] || {}
|
967
|
+
|
968
|
+
# header parameters
|
969
|
+
header_params = opts[:header_params] || {}
|
970
|
+
# klaviyo api revision
|
971
|
+
header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
|
972
|
+
# HTTP header 'Accept' (if needed)
|
973
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
974
|
+
# HTTP header 'Content-Type'
|
975
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
976
|
+
if !content_type.nil?
|
977
|
+
header_params['Content-Type'] = content_type
|
978
|
+
end
|
979
|
+
|
980
|
+
# form parameters
|
981
|
+
form_params = opts[:form_params] || {}
|
982
|
+
|
983
|
+
# http body (model)
|
984
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(flow_update_query)
|
985
|
+
|
986
|
+
# return_type
|
987
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
988
|
+
|
989
|
+
# auth_names
|
990
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
991
|
+
|
992
|
+
new_options = opts.merge(
|
993
|
+
:operation => :"FlowsApi.update_flow",
|
994
|
+
:header_params => header_params,
|
995
|
+
:query_params => query_params,
|
996
|
+
:form_params => form_params,
|
997
|
+
:body => post_body,
|
998
|
+
:auth_names => auth_names,
|
999
|
+
:return_type => return_type
|
1000
|
+
)
|
1001
|
+
|
1002
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1003
|
+
if @api_client.config.debugging
|
1004
|
+
@api_client.config.logger.debug "API called: FlowsApi#update_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1005
|
+
end
|
1006
|
+
return data, status_code, headers
|
1007
|
+
end
|
1008
|
+
end
|
1009
|
+
end
|