klaviyo-api-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +314 -136
- data/docs/CampaignRecipientEstimationJobCreateQuery.md +18 -0
- data/docs/CampaignRecipientEstimationJobCreateQueryAsSubResource.md +20 -0
- data/docs/CampaignRecipientEstimationJobCreateQueryAsSubResourceAttributes.md +18 -0
- data/docs/CampaignTagOp.md +18 -0
- data/docs/CampaignTagOpDataInner.md +20 -0
- data/docs/CampaignsApi.md +1277 -0
- data/docs/CatalogCategoryCreateJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogCategoryCreateQueryAsSubResourceAttributes.md +6 -6
- data/docs/CatalogCategoryDeleteJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogCategoryDeleteQueryAsSubResource.md +2 -2
- data/docs/CatalogCategoryUpdateJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogCategoryUpdateQueryAsSubResource.md +2 -2
- data/docs/CatalogCategoryUpdateQueryAsSubResourceAttributes.md +2 -2
- data/docs/CatalogItemCreateJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogItemCreateQueryAsSubResourceAttributes.md +21 -19
- data/docs/CatalogItemDeleteJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogItemDeleteQueryAsSubResource.md +2 -2
- data/docs/CatalogItemUpdateJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogItemUpdateQueryAsSubResource.md +2 -2
- data/docs/CatalogItemUpdateQueryAsSubResourceAttributes.md +18 -16
- data/docs/CatalogJobErrorPayload.md +8 -8
- data/docs/CatalogVariantCreateJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogVariantCreateQueryAsSubResourceAttributes.md +27 -27
- data/docs/CatalogVariantDeleteJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogVariantDeleteQueryAsSubResource.md +2 -2
- data/docs/CatalogVariantUpdateJobCreateQueryAsSubResourceAttributes.md +1 -1
- data/docs/CatalogVariantUpdateQueryAsSubResource.md +2 -2
- data/docs/CatalogVariantUpdateQueryAsSubResourceAttributes.md +22 -22
- data/docs/CatalogsApi.md +238 -238
- data/docs/ErrorSource.md +1 -1
- data/docs/EventsApi.md +26 -26
- data/docs/FlowsApi.md +64 -56
- data/docs/GetCampaigns4XXResponse.md +18 -0
- data/docs/GetCampaigns4XXResponseErrorsInner.md +26 -0
- data/docs/GetCampaigns4XXResponseErrorsInnerSource.md +20 -0
- data/docs/IncludedCategories.md +2 -2
- data/docs/IncludedCategoriesAttributes.md +5 -5
- data/docs/IncludedItems.md +2 -2
- data/docs/IncludedItemsAttributes.md +22 -20
- data/docs/IncludedLists.md +2 -2
- data/docs/IncludedListsAttributes.md +4 -4
- data/docs/IncludedProfiles.md +2 -2
- data/docs/IncludedProfilesAttributes.md +21 -21
- data/docs/IncludedSegments.md +1 -1
- data/docs/IncludedSegmentsAttributes.md +22 -0
- data/docs/IncludedTags.md +24 -0
- data/docs/IncludedVariants.md +2 -2
- data/docs/IncludedVariantsAttributes.md +28 -28
- data/docs/ListCreateQueryAsSubResourceAttributes.md +2 -2
- data/docs/ListPartialUpdateQueryAsSubResource.md +2 -2
- data/docs/ListsApi.md +30 -30
- data/docs/MetricAggregateQueryAsSubResourceAttributes.md +5 -5
- data/docs/MetricsApi.md +9 -9
- data/docs/OnsiteProfileMetaIdentifiers.md +10 -10
- data/docs/ProfileCreateQueryAsSubResourceAttributes.md +18 -18
- data/docs/ProfileLocation.md +15 -15
- data/docs/ProfileLocationLongitude.md +49 -0
- data/docs/ProfilePartialUpdateQueryAsSubResource.md +2 -2
- data/docs/ProfilesApi.md +26 -26
- data/docs/STOScheduleOptions.md +18 -0
- data/docs/SegmentPartialUpdateQueryAsSubResource.md +1 -1
- data/docs/SegmentPartialUpdateQueryAsSubResourceAttributes.md +18 -0
- data/docs/SegmentsApi.md +19 -19
- data/docs/SendOptionsSubObject.md +1 -3
- data/docs/SendStrategySubObject.md +4 -2
- data/docs/Subscription.md +8 -4
- data/docs/SubscriptionChannels.md +20 -0
- data/docs/SubscriptionCreateJobCreateQueryAsSubResourceAttributes.md +2 -2
- data/docs/Suppression.md +1 -1
- data/docs/TagsApi.md +24 -24
- data/docs/TemplateCloneQueryAsSubResource.md +0 -2
- data/docs/TemplatesApi.md +11 -11
- data/docs/ThrottledScheduleOptions.md +1 -1
- data/docs/UnsubscriptionCreateJobCreateQueryAsSubResourceAttributes.md +3 -3
- data/klaviyo-api-sdk.gemspec +2 -2
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +1275 -0
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +299 -299
- data/lib/klaviyo-api-sdk/api/client_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +2 -2
- data/lib/klaviyo-api-sdk/api/events_api.rb +33 -33
- data/lib/klaviyo-api-sdk/api/flows_api.rb +86 -74
- data/lib/klaviyo-api-sdk/api/lists_api.rb +39 -39
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +14 -14
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +34 -34
- data/lib/klaviyo-api-sdk/api/segments_api.rb +25 -25
- data/lib/klaviyo-api-sdk/api/tags_api.rb +41 -41
- data/lib/klaviyo-api-sdk/api/templates_api.rb +18 -18
- data/lib/klaviyo-api-sdk/api_client.rb +2 -2
- data/lib/klaviyo-api-sdk/api_error.rb +1 -1
- data/lib/klaviyo-api-sdk/configuration.rb +1 -1
- data/lib/klaviyo-api-sdk/models/audiences_sub_object.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_clone_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_clone_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_clone_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_message_assign_template_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_message_partial_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_partial_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_partial_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_partial_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query.rb +224 -0
- data/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query_as_sub_resource.rb +272 -0
- data/lib/klaviyo-api-sdk/models/campaign_recipient_estimation_job_create_query_as_sub_resource_attributes.rb +225 -0
- data/lib/klaviyo-api-sdk/models/campaign_send_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_send_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_send_job_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/campaign_tag_op.rb +226 -0
- data/lib/klaviyo-api-sdk/models/campaign_tag_op_data_inner.rb +272 -0
- data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_create_query_as_sub_resource_attributes.rb +5 -2
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_delete_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_category_update_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/catalog_category_update_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_attributes.rb +23 -3
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships_categories.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships_categories_data_inner.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_delete_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_item_update_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/catalog_item_update_query_as_sub_resource_attributes.rb +20 -2
- data/lib/klaviyo-api-sdk/models/catalog_job_error_payload.rb +5 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_attributes.rb +16 -8
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships_items.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships_items_data_inner.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/catalog_variant_update_query_as_sub_resource_attributes.rb +12 -2
- data/lib/klaviyo-api-sdk/models/content_sub_object.rb +1 -1
- data/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/data_privacy_create_deletion_job_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/email_message_content.rb +1 -1
- data/lib/klaviyo-api-sdk/models/email_tracking_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/error_source.rb +2 -1
- data/lib/klaviyo-api-sdk/models/event_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/event_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/event_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/get_campaigns4_xx_response.rb +226 -0
- data/lib/klaviyo-api-sdk/models/get_campaigns4_xx_response_errors_inner.rb +275 -0
- data/lib/klaviyo-api-sdk/models/get_campaigns4_xx_response_errors_inner_source.rb +228 -0
- data/lib/klaviyo-api-sdk/models/included_categories.rb +2 -2
- data/lib/klaviyo-api-sdk/models/included_categories_attributes.rb +4 -1
- data/lib/klaviyo-api-sdk/models/included_flow_action.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flow_actions.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flow_actions_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flow_actions_attributes_tracking_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flow_messages.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flow_messages_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flow_messages_attributes_content.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flows.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_flows_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_items.rb +2 -1
- data/lib/klaviyo-api-sdk/models/included_items_attributes.rb +23 -2
- data/lib/klaviyo-api-sdk/models/included_lists.rb +2 -1
- data/lib/klaviyo-api-sdk/models/included_lists_attributes.rb +4 -1
- data/lib/klaviyo-api-sdk/models/included_metrics.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_metrics_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/included_profiles.rb +2 -1
- data/lib/klaviyo-api-sdk/models/included_profiles_attributes.rb +13 -1
- data/lib/klaviyo-api-sdk/models/included_segments.rb +2 -2
- data/lib/klaviyo-api-sdk/models/included_segments_attributes.rb +240 -0
- data/lib/klaviyo-api-sdk/models/included_tags.rb +301 -0
- data/lib/klaviyo-api-sdk/models/included_variants.rb +2 -1
- data/lib/klaviyo-api-sdk/models/included_variants_attributes.rb +16 -2
- data/lib/klaviyo-api-sdk/models/included_variants_links.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_create_query_as_sub_resource_attributes.rb +2 -1
- data/lib/klaviyo-api-sdk/models/list_members_add_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_members_delete_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_partial_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/list_partial_update_query_as_sub_resource.rb +2 -1
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_as_sub_resource_attributes.rb +17 -15
- data/lib/klaviyo-api-sdk/models/metric_aggregate_row_dto.rb +1 -1
- data/lib/klaviyo-api-sdk/models/metric_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/onsite_profile_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/onsite_profile_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +1 -1
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta_identifiers.rb +16 -11
- data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_create_query_as_sub_resource_attributes.rb +10 -1
- data/lib/klaviyo-api-sdk/models/profile_location.rb +9 -2
- data/lib/klaviyo-api-sdk/models/profile_location_latitude.rb +2 -1
- data/lib/klaviyo-api-sdk/models/profile_location_longitude.rb +106 -0
- data/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_partial_update_query_as_sub_resource.rb +2 -1
- data/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/segment_partial_update_query_as_sub_resource.rb +2 -2
- data/lib/klaviyo-api-sdk/models/segment_partial_update_query_as_sub_resource_attributes.rb +224 -0
- data/lib/klaviyo-api-sdk/models/send_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/send_options_sub_object.rb +5 -15
- data/lib/klaviyo-api-sdk/models/send_strategy_sub_object.rb +15 -6
- data/lib/klaviyo-api-sdk/models/send_time_sub_object.rb +1 -1
- data/lib/klaviyo-api-sdk/models/sms_message_content.rb +1 -1
- data/lib/klaviyo-api-sdk/models/sms_render_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/sms_tracking_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/static_schedule_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/sto_schedule_options.rb +225 -0
- data/lib/klaviyo-api-sdk/models/subscription.rb +26 -5
- data/lib/klaviyo-api-sdk/models/subscription_channels.rb +256 -0
- data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/suppression.rb +1 -1
- data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_group_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_group_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_group_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_group_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_group_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_group_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_segment_op.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_segment_op_data_inner.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tag_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_clone_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_clone_query_as_sub_resource.rb +2 -13
- data/lib/klaviyo-api-sdk/models/template_clone_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_render_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_render_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_render_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_update_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_update_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/template_update_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/throttled_schedule_options.rb +1 -1
- data/lib/klaviyo-api-sdk/models/tracking_options_sub_object.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query_as_sub_resource.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query_as_sub_resource_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/utm_param_info.rb +1 -1
- data/lib/klaviyo-api-sdk/models/utm_params_sub_object.rb +1 -1
- data/lib/klaviyo-api-sdk/version.rb +1 -1
- data/lib/klaviyo-api-sdk.rb +14 -5
- data/spec/api/campaigns_api_spec.rb +284 -0
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/campaign_recipient_estimation_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/campaign_recipient_estimation_job_create_query_as_sub_resource_spec.rb +44 -0
- data/spec/models/campaign_recipient_estimation_job_create_query_spec.rb +34 -0
- data/spec/models/campaign_tag_op_data_inner_spec.rb +44 -0
- data/spec/models/campaign_tag_op_spec.rb +34 -0
- data/spec/models/get_campaigns4_xx_response_errors_inner_source_spec.rb +40 -0
- data/spec/models/get_campaigns4_xx_response_errors_inner_spec.rb +58 -0
- data/spec/models/get_campaigns4_xx_response_spec.rb +34 -0
- data/spec/models/included_segments_attributes_spec.rb +46 -0
- data/spec/models/included_tags_spec.rb +56 -0
- data/spec/models/profile_location_longitude_spec.rb +31 -0
- data/spec/models/segment_partial_update_query_as_sub_resource_attributes_spec.rb +34 -0
- data/spec/models/sto_schedule_options_spec.rb +34 -0
- data/spec/models/subscription_channels_spec.rb +48 -0
- data/spec/spec_helper.rb +1 -1
- metadata +51 -6
@@ -0,0 +1,1275 @@
|
|
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: 2023-02-22
|
7
|
+
Contact: developers@klaviyo.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module KlaviyoAPI
|
16
|
+
class CampaignsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create Campaign
|
23
|
+
# Creates a campaign given a set of parameters, then returns it.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
24
|
+
# @param campaign_create_query [CampaignCreateQuery] Creates a campaign from parameters
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Hash<String, Object>]
|
27
|
+
def create_campaign(campaign_create_query, opts = {})
|
28
|
+
data, _status_code, _headers = create_campaign_with_http_info(campaign_create_query, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create Campaign
|
33
|
+
# Creates a campaign given a set of parameters, then returns it.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
34
|
+
# @param campaign_create_query [CampaignCreateQuery] Creates a campaign from parameters
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
37
|
+
def create_campaign_with_http_info(campaign_create_query, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'campaign_create_query' is set
|
42
|
+
if @api_client.config.client_side_validation && campaign_create_query.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'campaign_create_query' when calling CampaignsApi.create_campaign"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/api/campaigns/'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# klaviyo api revision
|
54
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
+
# HTTP header 'Content-Type'
|
58
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
59
|
+
if !content_type.nil?
|
60
|
+
header_params['Content-Type'] = content_type
|
61
|
+
end
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = opts[:form_params] || {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_create_query)
|
68
|
+
|
69
|
+
# return_type
|
70
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
71
|
+
|
72
|
+
# auth_names
|
73
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
74
|
+
|
75
|
+
new_options = opts.merge(
|
76
|
+
:operation => :"CampaignsApi.create_campaign",
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: CampaignsApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Create Campaign Clone
|
93
|
+
# Clones an existing campaign, returning a new campaign based on the original with a new ID and name.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
94
|
+
# @param campaign_clone_query [CampaignCloneQuery] Clones a campaign from an existing campaign
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Hash<String, Object>]
|
97
|
+
def create_campaign_clone(campaign_clone_query, opts = {})
|
98
|
+
data, _status_code, _headers = create_campaign_clone_with_http_info(campaign_clone_query, opts)
|
99
|
+
data
|
100
|
+
end
|
101
|
+
|
102
|
+
# Create Campaign Clone
|
103
|
+
# Clones an existing campaign, returning a new campaign based on the original with a new ID and name.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
104
|
+
# @param campaign_clone_query [CampaignCloneQuery] Clones a campaign from an existing campaign
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
107
|
+
def create_campaign_clone_with_http_info(campaign_clone_query, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_clone ...'
|
110
|
+
end
|
111
|
+
# verify the required parameter 'campaign_clone_query' is set
|
112
|
+
if @api_client.config.client_side_validation && campaign_clone_query.nil?
|
113
|
+
fail ArgumentError, "Missing the required parameter 'campaign_clone_query' when calling CampaignsApi.create_campaign_clone"
|
114
|
+
end
|
115
|
+
# resource path
|
116
|
+
local_var_path = '/api/campaign-clone/'
|
117
|
+
|
118
|
+
# query parameters
|
119
|
+
query_params = opts[:query_params] || {}
|
120
|
+
|
121
|
+
# header parameters
|
122
|
+
header_params = opts[:header_params] || {}
|
123
|
+
# klaviyo api revision
|
124
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
125
|
+
# HTTP header 'Accept' (if needed)
|
126
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
127
|
+
# HTTP header 'Content-Type'
|
128
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
129
|
+
if !content_type.nil?
|
130
|
+
header_params['Content-Type'] = content_type
|
131
|
+
end
|
132
|
+
|
133
|
+
# form parameters
|
134
|
+
form_params = opts[:form_params] || {}
|
135
|
+
|
136
|
+
# http body (model)
|
137
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_clone_query)
|
138
|
+
|
139
|
+
# return_type
|
140
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
141
|
+
|
142
|
+
# auth_names
|
143
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
144
|
+
|
145
|
+
new_options = opts.merge(
|
146
|
+
:operation => :"CampaignsApi.create_campaign_clone",
|
147
|
+
:header_params => header_params,
|
148
|
+
:query_params => query_params,
|
149
|
+
:form_params => form_params,
|
150
|
+
:body => post_body,
|
151
|
+
:auth_names => auth_names,
|
152
|
+
:return_type => return_type
|
153
|
+
)
|
154
|
+
|
155
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug "API called: CampaignsApi#create_campaign_clone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
158
|
+
end
|
159
|
+
return data, status_code, headers
|
160
|
+
end
|
161
|
+
|
162
|
+
# Create Campaign Message Assign Template
|
163
|
+
# Creates a non-reusable version of the template and assigns it to the message.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
164
|
+
# @param campaign_message_assign_template_query [CampaignMessageAssignTemplateQuery] Takes a reusable template, clones it, and assigns the non-reusable clone to the message.
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @return [Hash<String, Object>]
|
167
|
+
def create_campaign_message_assign_template(campaign_message_assign_template_query, opts = {})
|
168
|
+
data, _status_code, _headers = create_campaign_message_assign_template_with_http_info(campaign_message_assign_template_query, opts)
|
169
|
+
data
|
170
|
+
end
|
171
|
+
|
172
|
+
# Create Campaign Message Assign Template
|
173
|
+
# Creates a non-reusable version of the template and assigns it to the message.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
174
|
+
# @param campaign_message_assign_template_query [CampaignMessageAssignTemplateQuery] Takes a reusable template, clones it, and assigns the non-reusable clone to the message.
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
177
|
+
def create_campaign_message_assign_template_with_http_info(campaign_message_assign_template_query, opts = {})
|
178
|
+
if @api_client.config.debugging
|
179
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_message_assign_template ...'
|
180
|
+
end
|
181
|
+
# verify the required parameter 'campaign_message_assign_template_query' is set
|
182
|
+
if @api_client.config.client_side_validation && campaign_message_assign_template_query.nil?
|
183
|
+
fail ArgumentError, "Missing the required parameter 'campaign_message_assign_template_query' when calling CampaignsApi.create_campaign_message_assign_template"
|
184
|
+
end
|
185
|
+
# resource path
|
186
|
+
local_var_path = '/api/campaign-message-assign-template/'
|
187
|
+
|
188
|
+
# query parameters
|
189
|
+
query_params = opts[:query_params] || {}
|
190
|
+
|
191
|
+
# header parameters
|
192
|
+
header_params = opts[:header_params] || {}
|
193
|
+
# klaviyo api revision
|
194
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
195
|
+
# HTTP header 'Accept' (if needed)
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
197
|
+
# HTTP header 'Content-Type'
|
198
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
199
|
+
if !content_type.nil?
|
200
|
+
header_params['Content-Type'] = content_type
|
201
|
+
end
|
202
|
+
|
203
|
+
# form parameters
|
204
|
+
form_params = opts[:form_params] || {}
|
205
|
+
|
206
|
+
# http body (model)
|
207
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_message_assign_template_query)
|
208
|
+
|
209
|
+
# return_type
|
210
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
211
|
+
|
212
|
+
# auth_names
|
213
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
214
|
+
|
215
|
+
new_options = opts.merge(
|
216
|
+
:operation => :"CampaignsApi.create_campaign_message_assign_template",
|
217
|
+
:header_params => header_params,
|
218
|
+
:query_params => query_params,
|
219
|
+
:form_params => form_params,
|
220
|
+
:body => post_body,
|
221
|
+
:auth_names => auth_names,
|
222
|
+
:return_type => return_type
|
223
|
+
)
|
224
|
+
|
225
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
226
|
+
if @api_client.config.debugging
|
227
|
+
@api_client.config.logger.debug "API called: CampaignsApi#create_campaign_message_assign_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
228
|
+
end
|
229
|
+
return data, status_code, headers
|
230
|
+
end
|
231
|
+
|
232
|
+
# Create Campaign Recipient Estimation Job
|
233
|
+
# Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
234
|
+
# @param campaign_recipient_estimation_job_create_query [CampaignRecipientEstimationJobCreateQuery] Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.
|
235
|
+
# @param [Hash] opts the optional parameters
|
236
|
+
# @return [Hash<String, Object>]
|
237
|
+
def create_campaign_recipient_estimation_job(campaign_recipient_estimation_job_create_query, opts = {})
|
238
|
+
data, _status_code, _headers = create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_estimation_job_create_query, opts)
|
239
|
+
data
|
240
|
+
end
|
241
|
+
|
242
|
+
# Create Campaign Recipient Estimation Job
|
243
|
+
# Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
244
|
+
# @param campaign_recipient_estimation_job_create_query [CampaignRecipientEstimationJobCreateQuery] Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get Campaign Recipient Estimation Job` endpoint to retrieve the status of this estimation job. Use the `Get Campaign Recipient Estimation` endpoint to retrieve the estimated recipient count for a given campaign.
|
245
|
+
# @param [Hash] opts the optional parameters
|
246
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
247
|
+
def create_campaign_recipient_estimation_job_with_http_info(campaign_recipient_estimation_job_create_query, opts = {})
|
248
|
+
if @api_client.config.debugging
|
249
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_recipient_estimation_job ...'
|
250
|
+
end
|
251
|
+
# verify the required parameter 'campaign_recipient_estimation_job_create_query' is set
|
252
|
+
if @api_client.config.client_side_validation && campaign_recipient_estimation_job_create_query.nil?
|
253
|
+
fail ArgumentError, "Missing the required parameter 'campaign_recipient_estimation_job_create_query' when calling CampaignsApi.create_campaign_recipient_estimation_job"
|
254
|
+
end
|
255
|
+
# resource path
|
256
|
+
local_var_path = '/api/campaign-recipient-estimation-jobs/'
|
257
|
+
|
258
|
+
# query parameters
|
259
|
+
query_params = opts[:query_params] || {}
|
260
|
+
|
261
|
+
# header parameters
|
262
|
+
header_params = opts[:header_params] || {}
|
263
|
+
# klaviyo api revision
|
264
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
265
|
+
# HTTP header 'Accept' (if needed)
|
266
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
267
|
+
# HTTP header 'Content-Type'
|
268
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
269
|
+
if !content_type.nil?
|
270
|
+
header_params['Content-Type'] = content_type
|
271
|
+
end
|
272
|
+
|
273
|
+
# form parameters
|
274
|
+
form_params = opts[:form_params] || {}
|
275
|
+
|
276
|
+
# http body (model)
|
277
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_recipient_estimation_job_create_query)
|
278
|
+
|
279
|
+
# return_type
|
280
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
281
|
+
|
282
|
+
# auth_names
|
283
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
284
|
+
|
285
|
+
new_options = opts.merge(
|
286
|
+
:operation => :"CampaignsApi.create_campaign_recipient_estimation_job",
|
287
|
+
:header_params => header_params,
|
288
|
+
:query_params => query_params,
|
289
|
+
:form_params => form_params,
|
290
|
+
:body => post_body,
|
291
|
+
:auth_names => auth_names,
|
292
|
+
:return_type => return_type
|
293
|
+
)
|
294
|
+
|
295
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
296
|
+
if @api_client.config.debugging
|
297
|
+
@api_client.config.logger.debug "API called: CampaignsApi#create_campaign_recipient_estimation_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
298
|
+
end
|
299
|
+
return data, status_code, headers
|
300
|
+
end
|
301
|
+
|
302
|
+
# Create Campaign Send Job
|
303
|
+
# Trigger a campaign to send asynchronously<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
304
|
+
# @param campaign_send_job_create_query [CampaignSendJobCreateQuery] Trigger the campaign to send asynchronously
|
305
|
+
# @param [Hash] opts the optional parameters
|
306
|
+
# @return [Hash<String, Object>]
|
307
|
+
def create_campaign_send_job(campaign_send_job_create_query, opts = {})
|
308
|
+
data, _status_code, _headers = create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts)
|
309
|
+
data
|
310
|
+
end
|
311
|
+
|
312
|
+
# Create Campaign Send Job
|
313
|
+
# Trigger a campaign to send asynchronously<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
314
|
+
# @param campaign_send_job_create_query [CampaignSendJobCreateQuery] Trigger the campaign to send asynchronously
|
315
|
+
# @param [Hash] opts the optional parameters
|
316
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
317
|
+
def create_campaign_send_job_with_http_info(campaign_send_job_create_query, opts = {})
|
318
|
+
if @api_client.config.debugging
|
319
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.create_campaign_send_job ...'
|
320
|
+
end
|
321
|
+
# verify the required parameter 'campaign_send_job_create_query' is set
|
322
|
+
if @api_client.config.client_side_validation && campaign_send_job_create_query.nil?
|
323
|
+
fail ArgumentError, "Missing the required parameter 'campaign_send_job_create_query' when calling CampaignsApi.create_campaign_send_job"
|
324
|
+
end
|
325
|
+
# resource path
|
326
|
+
local_var_path = '/api/campaign-send-jobs/'
|
327
|
+
|
328
|
+
# query parameters
|
329
|
+
query_params = opts[:query_params] || {}
|
330
|
+
|
331
|
+
# header parameters
|
332
|
+
header_params = opts[:header_params] || {}
|
333
|
+
# klaviyo api revision
|
334
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
335
|
+
# HTTP header 'Accept' (if needed)
|
336
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
337
|
+
# HTTP header 'Content-Type'
|
338
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
339
|
+
if !content_type.nil?
|
340
|
+
header_params['Content-Type'] = content_type
|
341
|
+
end
|
342
|
+
|
343
|
+
# form parameters
|
344
|
+
form_params = opts[:form_params] || {}
|
345
|
+
|
346
|
+
# http body (model)
|
347
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_send_job_create_query)
|
348
|
+
|
349
|
+
# return_type
|
350
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
351
|
+
|
352
|
+
# auth_names
|
353
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
354
|
+
|
355
|
+
new_options = opts.merge(
|
356
|
+
:operation => :"CampaignsApi.create_campaign_send_job",
|
357
|
+
:header_params => header_params,
|
358
|
+
:query_params => query_params,
|
359
|
+
:form_params => form_params,
|
360
|
+
:body => post_body,
|
361
|
+
:auth_names => auth_names,
|
362
|
+
:return_type => return_type
|
363
|
+
)
|
364
|
+
|
365
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
366
|
+
if @api_client.config.debugging
|
367
|
+
@api_client.config.logger.debug "API called: CampaignsApi#create_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
368
|
+
end
|
369
|
+
return data, status_code, headers
|
370
|
+
end
|
371
|
+
|
372
|
+
# Delete Campaign
|
373
|
+
# Delete a campaign with the given campaign ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
374
|
+
# @param id [String] The campaign ID to be deleted
|
375
|
+
# @param [Hash] opts the optional parameters
|
376
|
+
# @return [nil]
|
377
|
+
def delete_campaign(id, opts = {})
|
378
|
+
delete_campaign_with_http_info(id, opts)
|
379
|
+
nil
|
380
|
+
end
|
381
|
+
|
382
|
+
# Delete Campaign
|
383
|
+
# Delete a campaign with the given campaign ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
384
|
+
# @param id [String] The campaign ID to be deleted
|
385
|
+
# @param [Hash] opts the optional parameters
|
386
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
387
|
+
def delete_campaign_with_http_info(id, opts = {})
|
388
|
+
if @api_client.config.debugging
|
389
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.delete_campaign ...'
|
390
|
+
end
|
391
|
+
# verify the required parameter 'id' is set
|
392
|
+
if @api_client.config.client_side_validation && id.nil?
|
393
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.delete_campaign"
|
394
|
+
end
|
395
|
+
# resource path
|
396
|
+
local_var_path = '/api/campaigns/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
397
|
+
|
398
|
+
# query parameters
|
399
|
+
query_params = opts[:query_params] || {}
|
400
|
+
|
401
|
+
# header parameters
|
402
|
+
header_params = opts[:header_params] || {}
|
403
|
+
# klaviyo api revision
|
404
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
405
|
+
# HTTP header 'Accept' (if needed)
|
406
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
407
|
+
|
408
|
+
# form parameters
|
409
|
+
form_params = opts[:form_params] || {}
|
410
|
+
|
411
|
+
# http body (model)
|
412
|
+
post_body = opts[:debug_body]
|
413
|
+
|
414
|
+
# return_type
|
415
|
+
return_type = opts[:debug_return_type]
|
416
|
+
|
417
|
+
# auth_names
|
418
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
419
|
+
|
420
|
+
new_options = opts.merge(
|
421
|
+
:operation => :"CampaignsApi.delete_campaign",
|
422
|
+
:header_params => header_params,
|
423
|
+
:query_params => query_params,
|
424
|
+
:form_params => form_params,
|
425
|
+
:body => post_body,
|
426
|
+
:auth_names => auth_names,
|
427
|
+
:return_type => return_type
|
428
|
+
)
|
429
|
+
|
430
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
431
|
+
if @api_client.config.debugging
|
432
|
+
@api_client.config.logger.debug "API called: CampaignsApi#delete_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
433
|
+
end
|
434
|
+
return data, status_code, headers
|
435
|
+
end
|
436
|
+
|
437
|
+
# Get Campaign
|
438
|
+
# Returns a specific campaign based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
439
|
+
# @param id [String] The campaign ID to be retrieved
|
440
|
+
# @param [Hash] opts the optional parameters
|
441
|
+
# @option opts [Array<String>] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
442
|
+
# @option opts [Array<String>] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
443
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#relationships
|
444
|
+
# @return [Hash<String, Object>]
|
445
|
+
def get_campaign(id, opts = {})
|
446
|
+
data, _status_code, _headers = get_campaign_with_http_info(id, opts)
|
447
|
+
data
|
448
|
+
end
|
449
|
+
|
450
|
+
# Get Campaign
|
451
|
+
# Returns a specific campaign based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
452
|
+
# @param id [String] The campaign ID to be retrieved
|
453
|
+
# @param [Hash] opts the optional parameters
|
454
|
+
# @option opts [Array<String>] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
455
|
+
# @option opts [Array<String>] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
456
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#relationships
|
457
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
458
|
+
def get_campaign_with_http_info(id, opts = {})
|
459
|
+
if @api_client.config.debugging
|
460
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign ...'
|
461
|
+
end
|
462
|
+
# verify the required parameter 'id' is set
|
463
|
+
if @api_client.config.client_side_validation && id.nil?
|
464
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign"
|
465
|
+
end
|
466
|
+
allowable_values = ["name", "status", "archived", "channel", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "message", "tracking_options", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "tracking_options.is_add_utm", "tracking_options.utm_params", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"]
|
467
|
+
if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) }
|
468
|
+
fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}"
|
469
|
+
end
|
470
|
+
allowable_values = ["name"]
|
471
|
+
if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) }
|
472
|
+
fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}"
|
473
|
+
end
|
474
|
+
allowable_values = ["tags"]
|
475
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
476
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
477
|
+
end
|
478
|
+
# resource path
|
479
|
+
local_var_path = '/api/campaigns/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
480
|
+
|
481
|
+
# query parameters
|
482
|
+
query_params = opts[:query_params] || {}
|
483
|
+
query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil?
|
484
|
+
query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil?
|
485
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
486
|
+
|
487
|
+
# header parameters
|
488
|
+
header_params = opts[:header_params] || {}
|
489
|
+
# klaviyo api revision
|
490
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
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 => :"CampaignsApi.get_campaign",
|
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: CampaignsApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
519
|
+
end
|
520
|
+
return data, status_code, headers
|
521
|
+
end
|
522
|
+
|
523
|
+
# Get Campaign Message
|
524
|
+
# Returns a specific message based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
525
|
+
# @param id [String] The message ID to be retrieved
|
526
|
+
# @param [Hash] opts the optional parameters
|
527
|
+
# @option opts [Array<String>] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
528
|
+
# @return [Hash<String, Object>]
|
529
|
+
def get_campaign_message(id, opts = {})
|
530
|
+
data, _status_code, _headers = get_campaign_message_with_http_info(id, opts)
|
531
|
+
data
|
532
|
+
end
|
533
|
+
|
534
|
+
# Get Campaign Message
|
535
|
+
# Returns a specific message based on a required id.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
536
|
+
# @param id [String] The message ID to be retrieved
|
537
|
+
# @param [Hash] opts the optional parameters
|
538
|
+
# @option opts [Array<String>] :fields_campaign_message For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
539
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
540
|
+
def get_campaign_message_with_http_info(id, opts = {})
|
541
|
+
if @api_client.config.debugging
|
542
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_message ...'
|
543
|
+
end
|
544
|
+
# verify the required parameter 'id' is set
|
545
|
+
if @api_client.config.client_side_validation && id.nil?
|
546
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_message"
|
547
|
+
end
|
548
|
+
allowable_values = ["label", "channel", "content", "content.subject", "content.preview_text", "content.from_email", "content.from_label", "content.template_id", "content.template_name", "send_times", "created_at", "updated_at", "campaign_id"]
|
549
|
+
if @api_client.config.client_side_validation && opts[:'fields_campaign_message'] && !opts[:'fields_campaign_message'].all? { |item| allowable_values.include?(item) }
|
550
|
+
fail ArgumentError, "invalid value for \"fields_campaign_message\", must include one of #{allowable_values}"
|
551
|
+
end
|
552
|
+
# resource path
|
553
|
+
local_var_path = '/api/campaign-messages/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
554
|
+
|
555
|
+
# query parameters
|
556
|
+
query_params = opts[:query_params] || {}
|
557
|
+
query_params[:'fields[campaign-message]'] = @api_client.build_collection_param(opts[:'fields_campaign_message'], :csv) if !opts[:'fields_campaign_message'].nil?
|
558
|
+
|
559
|
+
# header parameters
|
560
|
+
header_params = opts[:header_params] || {}
|
561
|
+
# klaviyo api revision
|
562
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
563
|
+
# HTTP header 'Accept' (if needed)
|
564
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
565
|
+
|
566
|
+
# form parameters
|
567
|
+
form_params = opts[:form_params] || {}
|
568
|
+
|
569
|
+
# http body (model)
|
570
|
+
post_body = opts[:debug_body]
|
571
|
+
|
572
|
+
# return_type
|
573
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
574
|
+
|
575
|
+
# auth_names
|
576
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
577
|
+
|
578
|
+
new_options = opts.merge(
|
579
|
+
:operation => :"CampaignsApi.get_campaign_message",
|
580
|
+
:header_params => header_params,
|
581
|
+
:query_params => query_params,
|
582
|
+
:form_params => form_params,
|
583
|
+
:body => post_body,
|
584
|
+
:auth_names => auth_names,
|
585
|
+
:return_type => return_type
|
586
|
+
)
|
587
|
+
|
588
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
589
|
+
if @api_client.config.debugging
|
590
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
591
|
+
end
|
592
|
+
return data, status_code, headers
|
593
|
+
end
|
594
|
+
|
595
|
+
# Get Campaign Recipient Estimation
|
596
|
+
# Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
597
|
+
# @param id [String] The ID of the campaign for which to get the estimated number of recipients
|
598
|
+
# @param [Hash] opts the optional parameters
|
599
|
+
# @option opts [Array<String>] :fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
600
|
+
# @return [Hash<String, Object>]
|
601
|
+
def get_campaign_recipient_estimation(id, opts = {})
|
602
|
+
data, _status_code, _headers = get_campaign_recipient_estimation_with_http_info(id, opts)
|
603
|
+
data
|
604
|
+
end
|
605
|
+
|
606
|
+
# Get Campaign Recipient Estimation
|
607
|
+
# Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
608
|
+
# @param id [String] The ID of the campaign for which to get the estimated number of recipients
|
609
|
+
# @param [Hash] opts the optional parameters
|
610
|
+
# @option opts [Array<String>] :fields_campaign_recipient_estimation For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
611
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
612
|
+
def get_campaign_recipient_estimation_with_http_info(id, opts = {})
|
613
|
+
if @api_client.config.debugging
|
614
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_recipient_estimation ...'
|
615
|
+
end
|
616
|
+
# verify the required parameter 'id' is set
|
617
|
+
if @api_client.config.client_side_validation && id.nil?
|
618
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_recipient_estimation"
|
619
|
+
end
|
620
|
+
allowable_values = ["estimated_recipient_count"]
|
621
|
+
if @api_client.config.client_side_validation && opts[:'fields_campaign_recipient_estimation'] && !opts[:'fields_campaign_recipient_estimation'].all? { |item| allowable_values.include?(item) }
|
622
|
+
fail ArgumentError, "invalid value for \"fields_campaign_recipient_estimation\", must include one of #{allowable_values}"
|
623
|
+
end
|
624
|
+
# resource path
|
625
|
+
local_var_path = '/api/campaign-recipient-estimations/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
626
|
+
|
627
|
+
# query parameters
|
628
|
+
query_params = opts[:query_params] || {}
|
629
|
+
query_params[:'fields[campaign-recipient-estimation]'] = @api_client.build_collection_param(opts[:'fields_campaign_recipient_estimation'], :csv) if !opts[:'fields_campaign_recipient_estimation'].nil?
|
630
|
+
|
631
|
+
# header parameters
|
632
|
+
header_params = opts[:header_params] || {}
|
633
|
+
# klaviyo api revision
|
634
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
635
|
+
# HTTP header 'Accept' (if needed)
|
636
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
637
|
+
|
638
|
+
# form parameters
|
639
|
+
form_params = opts[:form_params] || {}
|
640
|
+
|
641
|
+
# http body (model)
|
642
|
+
post_body = opts[:debug_body]
|
643
|
+
|
644
|
+
# return_type
|
645
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
646
|
+
|
647
|
+
# auth_names
|
648
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
649
|
+
|
650
|
+
new_options = opts.merge(
|
651
|
+
:operation => :"CampaignsApi.get_campaign_recipient_estimation",
|
652
|
+
:header_params => header_params,
|
653
|
+
:query_params => query_params,
|
654
|
+
:form_params => form_params,
|
655
|
+
:body => post_body,
|
656
|
+
:auth_names => auth_names,
|
657
|
+
:return_type => return_type
|
658
|
+
)
|
659
|
+
|
660
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
661
|
+
if @api_client.config.debugging
|
662
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaign_recipient_estimation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
663
|
+
end
|
664
|
+
return data, status_code, headers
|
665
|
+
end
|
666
|
+
|
667
|
+
# Get Campaign Recipient Estimation Job
|
668
|
+
# Retrieve the status of a recipient estimation job triggered with the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
669
|
+
# @param id [String] The ID of the campaign to get recipient estimation status
|
670
|
+
# @param [Hash] opts the optional parameters
|
671
|
+
# @option opts [Array<String>] :fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
672
|
+
# @return [Hash<String, Object>]
|
673
|
+
def get_campaign_recipient_estimation_job(id, opts = {})
|
674
|
+
data, _status_code, _headers = get_campaign_recipient_estimation_job_with_http_info(id, opts)
|
675
|
+
data
|
676
|
+
end
|
677
|
+
|
678
|
+
# Get Campaign Recipient Estimation Job
|
679
|
+
# Retrieve the status of a recipient estimation job triggered with the `Create Campaign Recipient Estimation Job` endpoint.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
680
|
+
# @param id [String] The ID of the campaign to get recipient estimation status
|
681
|
+
# @param [Hash] opts the optional parameters
|
682
|
+
# @option opts [Array<String>] :fields_campaign_recipient_estimation_job For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
683
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
684
|
+
def get_campaign_recipient_estimation_job_with_http_info(id, opts = {})
|
685
|
+
if @api_client.config.debugging
|
686
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_recipient_estimation_job ...'
|
687
|
+
end
|
688
|
+
# verify the required parameter 'id' is set
|
689
|
+
if @api_client.config.client_side_validation && id.nil?
|
690
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_recipient_estimation_job"
|
691
|
+
end
|
692
|
+
allowable_values = ["status"]
|
693
|
+
if @api_client.config.client_side_validation && opts[:'fields_campaign_recipient_estimation_job'] && !opts[:'fields_campaign_recipient_estimation_job'].all? { |item| allowable_values.include?(item) }
|
694
|
+
fail ArgumentError, "invalid value for \"fields_campaign_recipient_estimation_job\", must include one of #{allowable_values}"
|
695
|
+
end
|
696
|
+
# resource path
|
697
|
+
local_var_path = '/api/campaign-recipient-estimation-jobs/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
698
|
+
|
699
|
+
# query parameters
|
700
|
+
query_params = opts[:query_params] || {}
|
701
|
+
query_params[:'fields[campaign-recipient-estimation-job]'] = @api_client.build_collection_param(opts[:'fields_campaign_recipient_estimation_job'], :csv) if !opts[:'fields_campaign_recipient_estimation_job'].nil?
|
702
|
+
|
703
|
+
# header parameters
|
704
|
+
header_params = opts[:header_params] || {}
|
705
|
+
# klaviyo api revision
|
706
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
707
|
+
# HTTP header 'Accept' (if needed)
|
708
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
709
|
+
|
710
|
+
# form parameters
|
711
|
+
form_params = opts[:form_params] || {}
|
712
|
+
|
713
|
+
# http body (model)
|
714
|
+
post_body = opts[:debug_body]
|
715
|
+
|
716
|
+
# return_type
|
717
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
718
|
+
|
719
|
+
# auth_names
|
720
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
721
|
+
|
722
|
+
new_options = opts.merge(
|
723
|
+
:operation => :"CampaignsApi.get_campaign_recipient_estimation_job",
|
724
|
+
:header_params => header_params,
|
725
|
+
:query_params => query_params,
|
726
|
+
:form_params => form_params,
|
727
|
+
:body => post_body,
|
728
|
+
:auth_names => auth_names,
|
729
|
+
:return_type => return_type
|
730
|
+
)
|
731
|
+
|
732
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
733
|
+
if @api_client.config.debugging
|
734
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaign_recipient_estimation_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
735
|
+
end
|
736
|
+
return data, status_code, headers
|
737
|
+
end
|
738
|
+
|
739
|
+
# Get Campaign Relationships
|
740
|
+
# If the `related_resource` is `tags`, returns the IDs of all tags associated with the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Campaigns Read` `Tags Read`
|
741
|
+
# @param id [String]
|
742
|
+
# @param related_resource [String]
|
743
|
+
# @param [Hash] opts the optional parameters
|
744
|
+
# @return [Hash<String, Object>]
|
745
|
+
def get_campaign_relationships(id, related_resource, opts = {})
|
746
|
+
data, _status_code, _headers = get_campaign_relationships_with_http_info(id, related_resource, opts)
|
747
|
+
data
|
748
|
+
end
|
749
|
+
|
750
|
+
# Get Campaign Relationships
|
751
|
+
# If the `related_resource` is `tags`, returns the IDs of all tags associated with the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Campaigns Read` `Tags Read`
|
752
|
+
# @param id [String]
|
753
|
+
# @param related_resource [String]
|
754
|
+
# @param [Hash] opts the optional parameters
|
755
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
756
|
+
def get_campaign_relationships_with_http_info(id, related_resource, opts = {})
|
757
|
+
if @api_client.config.debugging
|
758
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_relationships ...'
|
759
|
+
end
|
760
|
+
# verify the required parameter 'id' is set
|
761
|
+
if @api_client.config.client_side_validation && id.nil?
|
762
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_relationships"
|
763
|
+
end
|
764
|
+
# verify the required parameter 'related_resource' is set
|
765
|
+
if @api_client.config.client_side_validation && related_resource.nil?
|
766
|
+
fail ArgumentError, "Missing the required parameter 'related_resource' when calling CampaignsApi.get_campaign_relationships"
|
767
|
+
end
|
768
|
+
# resource path
|
769
|
+
local_var_path = '/api/campaigns/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s))
|
770
|
+
|
771
|
+
# query parameters
|
772
|
+
query_params = opts[:query_params] || {}
|
773
|
+
|
774
|
+
# header parameters
|
775
|
+
header_params = opts[:header_params] || {}
|
776
|
+
# klaviyo api revision
|
777
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
778
|
+
# HTTP header 'Accept' (if needed)
|
779
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
780
|
+
|
781
|
+
# form parameters
|
782
|
+
form_params = opts[:form_params] || {}
|
783
|
+
|
784
|
+
# http body (model)
|
785
|
+
post_body = opts[:debug_body]
|
786
|
+
|
787
|
+
# return_type
|
788
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
789
|
+
|
790
|
+
# auth_names
|
791
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
792
|
+
|
793
|
+
new_options = opts.merge(
|
794
|
+
:operation => :"CampaignsApi.get_campaign_relationships",
|
795
|
+
:header_params => header_params,
|
796
|
+
:query_params => query_params,
|
797
|
+
:form_params => form_params,
|
798
|
+
:body => post_body,
|
799
|
+
:auth_names => auth_names,
|
800
|
+
:return_type => return_type
|
801
|
+
)
|
802
|
+
|
803
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
804
|
+
if @api_client.config.debugging
|
805
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaign_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
806
|
+
end
|
807
|
+
return data, status_code, headers
|
808
|
+
end
|
809
|
+
|
810
|
+
# Get Campaign Send Job
|
811
|
+
# Get a campaign send job<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
812
|
+
# @param id [String] The ID of the campaign to send
|
813
|
+
# @param [Hash] opts the optional parameters
|
814
|
+
# @option opts [Array<String>] :fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
815
|
+
# @return [Hash<String, Object>]
|
816
|
+
def get_campaign_send_job(id, opts = {})
|
817
|
+
data, _status_code, _headers = get_campaign_send_job_with_http_info(id, opts)
|
818
|
+
data
|
819
|
+
end
|
820
|
+
|
821
|
+
# Get Campaign Send Job
|
822
|
+
# Get a campaign send job<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
823
|
+
# @param id [String] The ID of the campaign to send
|
824
|
+
# @param [Hash] opts the optional parameters
|
825
|
+
# @option opts [Array<String>] :fields_campaign_send_job For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
826
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
827
|
+
def get_campaign_send_job_with_http_info(id, opts = {})
|
828
|
+
if @api_client.config.debugging
|
829
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_send_job ...'
|
830
|
+
end
|
831
|
+
# verify the required parameter 'id' is set
|
832
|
+
if @api_client.config.client_side_validation && id.nil?
|
833
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.get_campaign_send_job"
|
834
|
+
end
|
835
|
+
allowable_values = ["status"]
|
836
|
+
if @api_client.config.client_side_validation && opts[:'fields_campaign_send_job'] && !opts[:'fields_campaign_send_job'].all? { |item| allowable_values.include?(item) }
|
837
|
+
fail ArgumentError, "invalid value for \"fields_campaign_send_job\", must include one of #{allowable_values}"
|
838
|
+
end
|
839
|
+
# resource path
|
840
|
+
local_var_path = '/api/campaign-send-jobs/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
841
|
+
|
842
|
+
# query parameters
|
843
|
+
query_params = opts[:query_params] || {}
|
844
|
+
query_params[:'fields[campaign-send-job]'] = @api_client.build_collection_param(opts[:'fields_campaign_send_job'], :csv) if !opts[:'fields_campaign_send_job'].nil?
|
845
|
+
|
846
|
+
# header parameters
|
847
|
+
header_params = opts[:header_params] || {}
|
848
|
+
# klaviyo api revision
|
849
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
850
|
+
# HTTP header 'Accept' (if needed)
|
851
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
852
|
+
|
853
|
+
# form parameters
|
854
|
+
form_params = opts[:form_params] || {}
|
855
|
+
|
856
|
+
# http body (model)
|
857
|
+
post_body = opts[:debug_body]
|
858
|
+
|
859
|
+
# return_type
|
860
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
861
|
+
|
862
|
+
# auth_names
|
863
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
864
|
+
|
865
|
+
new_options = opts.merge(
|
866
|
+
:operation => :"CampaignsApi.get_campaign_send_job",
|
867
|
+
:header_params => header_params,
|
868
|
+
:query_params => query_params,
|
869
|
+
:form_params => form_params,
|
870
|
+
:body => post_body,
|
871
|
+
:auth_names => auth_names,
|
872
|
+
:return_type => return_type
|
873
|
+
)
|
874
|
+
|
875
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
876
|
+
if @api_client.config.debugging
|
877
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
878
|
+
end
|
879
|
+
return data, status_code, headers
|
880
|
+
end
|
881
|
+
|
882
|
+
# Get Campaign Tags
|
883
|
+
# Return all tags that belong to the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Campaigns Read` `Tags Read`
|
884
|
+
# @param campaign_id [String]
|
885
|
+
# @param [Hash] opts the optional parameters
|
886
|
+
# @option opts [Array<String>] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
887
|
+
# @return [Hash<String, Object>]
|
888
|
+
def get_campaign_tags(campaign_id, opts = {})
|
889
|
+
data, _status_code, _headers = get_campaign_tags_with_http_info(campaign_id, opts)
|
890
|
+
data
|
891
|
+
end
|
892
|
+
|
893
|
+
# Get Campaign Tags
|
894
|
+
# Return all tags that belong to the given campaign.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Campaigns Read` `Tags Read`
|
895
|
+
# @param campaign_id [String]
|
896
|
+
# @param [Hash] opts the optional parameters
|
897
|
+
# @option opts [Array<String>] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
898
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
899
|
+
def get_campaign_tags_with_http_info(campaign_id, opts = {})
|
900
|
+
if @api_client.config.debugging
|
901
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaign_tags ...'
|
902
|
+
end
|
903
|
+
# verify the required parameter 'campaign_id' is set
|
904
|
+
if @api_client.config.client_side_validation && campaign_id.nil?
|
905
|
+
fail ArgumentError, "Missing the required parameter 'campaign_id' when calling CampaignsApi.get_campaign_tags"
|
906
|
+
end
|
907
|
+
allowable_values = ["name"]
|
908
|
+
if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) }
|
909
|
+
fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}"
|
910
|
+
end
|
911
|
+
# resource path
|
912
|
+
local_var_path = '/api/campaigns/{campaign_id}/tags/'.sub('{' + 'campaign_id' + '}', CGI.escape(campaign_id.to_s))
|
913
|
+
|
914
|
+
# query parameters
|
915
|
+
query_params = opts[:query_params] || {}
|
916
|
+
query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil?
|
917
|
+
|
918
|
+
# header parameters
|
919
|
+
header_params = opts[:header_params] || {}
|
920
|
+
# klaviyo api revision
|
921
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
922
|
+
# HTTP header 'Accept' (if needed)
|
923
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
924
|
+
|
925
|
+
# form parameters
|
926
|
+
form_params = opts[:form_params] || {}
|
927
|
+
|
928
|
+
# http body (model)
|
929
|
+
post_body = opts[:debug_body]
|
930
|
+
|
931
|
+
# return_type
|
932
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
933
|
+
|
934
|
+
# auth_names
|
935
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
936
|
+
|
937
|
+
new_options = opts.merge(
|
938
|
+
:operation => :"CampaignsApi.get_campaign_tags",
|
939
|
+
:header_params => header_params,
|
940
|
+
:query_params => query_params,
|
941
|
+
:form_params => form_params,
|
942
|
+
:body => post_body,
|
943
|
+
:auth_names => auth_names,
|
944
|
+
:return_type => return_type
|
945
|
+
)
|
946
|
+
|
947
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
948
|
+
if @api_client.config.debugging
|
949
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaign_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
950
|
+
end
|
951
|
+
return data, status_code, headers
|
952
|
+
end
|
953
|
+
|
954
|
+
# Get Campaigns
|
955
|
+
# Returns some or all campaigns based on [optional] filters<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
956
|
+
# @param [Hash] opts the optional parameters
|
957
|
+
# @option opts [Array<String>] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
958
|
+
# @option opts [Array<String>] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
959
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
960
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#relationships
|
961
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#pagination
|
962
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sorting
|
963
|
+
# @return [Hash<String, Object>]
|
964
|
+
def get_campaigns(opts = {})
|
965
|
+
data, _status_code, _headers = get_campaigns_with_http_info(opts)
|
966
|
+
data
|
967
|
+
end
|
968
|
+
|
969
|
+
# Get Campaigns
|
970
|
+
# Returns some or all campaigns based on [optional] filters<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Read`
|
971
|
+
# @param [Hash] opts the optional parameters
|
972
|
+
# @option opts [Array<String>] :fields_campaign For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
973
|
+
# @option opts [Array<String>] :fields_tag For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sparse-fieldsets
|
974
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`<br>`status`: `any`, `equals`<br>`archived`: `equals`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`scheduled_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
|
975
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#relationships
|
976
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#pagination
|
977
|
+
# @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2023-02-22/reference/api-overview#sorting
|
978
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
979
|
+
def get_campaigns_with_http_info(opts = {})
|
980
|
+
if @api_client.config.debugging
|
981
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.get_campaigns ...'
|
982
|
+
end
|
983
|
+
allowable_values = ["name", "status", "archived", "channel", "audiences", "audiences.included", "audiences.excluded", "send_options", "send_options.use_smart_sending", "message", "tracking_options", "tracking_options.is_tracking_opens", "tracking_options.is_tracking_clicks", "tracking_options.is_add_utm", "tracking_options.utm_params", "send_strategy", "send_strategy.method", "send_strategy.options_static", "send_strategy.options_static.datetime", "send_strategy.options_static.is_local", "send_strategy.options_static.send_past_recipients_immediately", "send_strategy.options_throttled", "send_strategy.options_throttled.datetime", "send_strategy.options_throttled.throttle_percentage", "send_strategy.options_sto", "send_strategy.options_sto.date", "created_at", "scheduled_at", "updated_at", "send_time"]
|
984
|
+
if @api_client.config.client_side_validation && opts[:'fields_campaign'] && !opts[:'fields_campaign'].all? { |item| allowable_values.include?(item) }
|
985
|
+
fail ArgumentError, "invalid value for \"fields_campaign\", must include one of #{allowable_values}"
|
986
|
+
end
|
987
|
+
allowable_values = ["name"]
|
988
|
+
if @api_client.config.client_side_validation && opts[:'fields_tag'] && !opts[:'fields_tag'].all? { |item| allowable_values.include?(item) }
|
989
|
+
fail ArgumentError, "invalid value for \"fields_tag\", must include one of #{allowable_values}"
|
990
|
+
end
|
991
|
+
allowable_values = ["tags"]
|
992
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
993
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
994
|
+
end
|
995
|
+
allowable_values = ["created_at", "-created_at", "id", "-id", "name", "-name", "scheduled_at", "-scheduled_at", "updated_at", "-updated_at"]
|
996
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
997
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
998
|
+
end
|
999
|
+
# resource path
|
1000
|
+
local_var_path = '/api/campaigns/'
|
1001
|
+
|
1002
|
+
# query parameters
|
1003
|
+
query_params = opts[:query_params] || {}
|
1004
|
+
query_params[:'fields[campaign]'] = @api_client.build_collection_param(opts[:'fields_campaign'], :csv) if !opts[:'fields_campaign'].nil?
|
1005
|
+
query_params[:'fields[tag]'] = @api_client.build_collection_param(opts[:'fields_tag'], :csv) if !opts[:'fields_tag'].nil?
|
1006
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
1007
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
1008
|
+
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
1009
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
1010
|
+
|
1011
|
+
# header parameters
|
1012
|
+
header_params = opts[:header_params] || {}
|
1013
|
+
# klaviyo api revision
|
1014
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
1015
|
+
# HTTP header 'Accept' (if needed)
|
1016
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1017
|
+
|
1018
|
+
# form parameters
|
1019
|
+
form_params = opts[:form_params] || {}
|
1020
|
+
|
1021
|
+
# http body (model)
|
1022
|
+
post_body = opts[:debug_body]
|
1023
|
+
|
1024
|
+
# return_type
|
1025
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1026
|
+
|
1027
|
+
# auth_names
|
1028
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1029
|
+
|
1030
|
+
new_options = opts.merge(
|
1031
|
+
:operation => :"CampaignsApi.get_campaigns",
|
1032
|
+
:header_params => header_params,
|
1033
|
+
:query_params => query_params,
|
1034
|
+
:form_params => form_params,
|
1035
|
+
:body => post_body,
|
1036
|
+
:auth_names => auth_names,
|
1037
|
+
:return_type => return_type
|
1038
|
+
)
|
1039
|
+
|
1040
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1041
|
+
if @api_client.config.debugging
|
1042
|
+
@api_client.config.logger.debug "API called: CampaignsApi#get_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1043
|
+
end
|
1044
|
+
return data, status_code, headers
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
# Update Campaign
|
1048
|
+
# Update a campaign with the given campaign ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
1049
|
+
# @param id [String] The campaign ID to be retrieved
|
1050
|
+
# @param campaign_partial_update_query [CampaignPartialUpdateQuery] Update a campaign and return it
|
1051
|
+
# @param [Hash] opts the optional parameters
|
1052
|
+
# @return [Hash<String, Object>]
|
1053
|
+
def update_campaign(id, campaign_partial_update_query, opts = {})
|
1054
|
+
data, _status_code, _headers = update_campaign_with_http_info(id, campaign_partial_update_query, opts)
|
1055
|
+
data
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
# Update Campaign
|
1059
|
+
# Update a campaign with the given campaign ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
1060
|
+
# @param id [String] The campaign ID to be retrieved
|
1061
|
+
# @param campaign_partial_update_query [CampaignPartialUpdateQuery] Update a campaign and return it
|
1062
|
+
# @param [Hash] opts the optional parameters
|
1063
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
1064
|
+
def update_campaign_with_http_info(id, campaign_partial_update_query, opts = {})
|
1065
|
+
if @api_client.config.debugging
|
1066
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign ...'
|
1067
|
+
end
|
1068
|
+
# verify the required parameter 'id' is set
|
1069
|
+
if @api_client.config.client_side_validation && id.nil?
|
1070
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign"
|
1071
|
+
end
|
1072
|
+
# verify the required parameter 'campaign_partial_update_query' is set
|
1073
|
+
if @api_client.config.client_side_validation && campaign_partial_update_query.nil?
|
1074
|
+
fail ArgumentError, "Missing the required parameter 'campaign_partial_update_query' when calling CampaignsApi.update_campaign"
|
1075
|
+
end
|
1076
|
+
# resource path
|
1077
|
+
local_var_path = '/api/campaigns/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1078
|
+
|
1079
|
+
# query parameters
|
1080
|
+
query_params = opts[:query_params] || {}
|
1081
|
+
|
1082
|
+
# header parameters
|
1083
|
+
header_params = opts[:header_params] || {}
|
1084
|
+
# klaviyo api revision
|
1085
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
1086
|
+
# HTTP header 'Accept' (if needed)
|
1087
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1088
|
+
# HTTP header 'Content-Type'
|
1089
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1090
|
+
if !content_type.nil?
|
1091
|
+
header_params['Content-Type'] = content_type
|
1092
|
+
end
|
1093
|
+
|
1094
|
+
# form parameters
|
1095
|
+
form_params = opts[:form_params] || {}
|
1096
|
+
|
1097
|
+
# http body (model)
|
1098
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_partial_update_query)
|
1099
|
+
|
1100
|
+
# return_type
|
1101
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1102
|
+
|
1103
|
+
# auth_names
|
1104
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1105
|
+
|
1106
|
+
new_options = opts.merge(
|
1107
|
+
:operation => :"CampaignsApi.update_campaign",
|
1108
|
+
:header_params => header_params,
|
1109
|
+
:query_params => query_params,
|
1110
|
+
:form_params => form_params,
|
1111
|
+
:body => post_body,
|
1112
|
+
:auth_names => auth_names,
|
1113
|
+
:return_type => return_type
|
1114
|
+
)
|
1115
|
+
|
1116
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1117
|
+
if @api_client.config.debugging
|
1118
|
+
@api_client.config.logger.debug "API called: CampaignsApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1119
|
+
end
|
1120
|
+
return data, status_code, headers
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
# Update Campaign Message
|
1124
|
+
# Update a campaign message<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
1125
|
+
# @param id [String] The message ID to be retrieved
|
1126
|
+
# @param campaign_message_partial_update_query [CampaignMessagePartialUpdateQuery] Update a message and return it
|
1127
|
+
# @param [Hash] opts the optional parameters
|
1128
|
+
# @return [Hash<String, Object>]
|
1129
|
+
def update_campaign_message(id, campaign_message_partial_update_query, opts = {})
|
1130
|
+
data, _status_code, _headers = update_campaign_message_with_http_info(id, campaign_message_partial_update_query, opts)
|
1131
|
+
data
|
1132
|
+
end
|
1133
|
+
|
1134
|
+
# Update Campaign Message
|
1135
|
+
# Update a campaign message<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
1136
|
+
# @param id [String] The message ID to be retrieved
|
1137
|
+
# @param campaign_message_partial_update_query [CampaignMessagePartialUpdateQuery] Update a message and return it
|
1138
|
+
# @param [Hash] opts the optional parameters
|
1139
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
1140
|
+
def update_campaign_message_with_http_info(id, campaign_message_partial_update_query, opts = {})
|
1141
|
+
if @api_client.config.debugging
|
1142
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign_message ...'
|
1143
|
+
end
|
1144
|
+
# verify the required parameter 'id' is set
|
1145
|
+
if @api_client.config.client_side_validation && id.nil?
|
1146
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign_message"
|
1147
|
+
end
|
1148
|
+
# verify the required parameter 'campaign_message_partial_update_query' is set
|
1149
|
+
if @api_client.config.client_side_validation && campaign_message_partial_update_query.nil?
|
1150
|
+
fail ArgumentError, "Missing the required parameter 'campaign_message_partial_update_query' when calling CampaignsApi.update_campaign_message"
|
1151
|
+
end
|
1152
|
+
# resource path
|
1153
|
+
local_var_path = '/api/campaign-messages/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1154
|
+
|
1155
|
+
# query parameters
|
1156
|
+
query_params = opts[:query_params] || {}
|
1157
|
+
|
1158
|
+
# header parameters
|
1159
|
+
header_params = opts[:header_params] || {}
|
1160
|
+
# klaviyo api revision
|
1161
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
1162
|
+
# HTTP header 'Accept' (if needed)
|
1163
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1164
|
+
# HTTP header 'Content-Type'
|
1165
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1166
|
+
if !content_type.nil?
|
1167
|
+
header_params['Content-Type'] = content_type
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
# form parameters
|
1171
|
+
form_params = opts[:form_params] || {}
|
1172
|
+
|
1173
|
+
# http body (model)
|
1174
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_message_partial_update_query)
|
1175
|
+
|
1176
|
+
# return_type
|
1177
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
1178
|
+
|
1179
|
+
# auth_names
|
1180
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1181
|
+
|
1182
|
+
new_options = opts.merge(
|
1183
|
+
:operation => :"CampaignsApi.update_campaign_message",
|
1184
|
+
:header_params => header_params,
|
1185
|
+
:query_params => query_params,
|
1186
|
+
:form_params => form_params,
|
1187
|
+
:body => post_body,
|
1188
|
+
:auth_names => auth_names,
|
1189
|
+
:return_type => return_type
|
1190
|
+
)
|
1191
|
+
|
1192
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1193
|
+
if @api_client.config.debugging
|
1194
|
+
@api_client.config.logger.debug "API called: CampaignsApi#update_campaign_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1195
|
+
end
|
1196
|
+
return data, status_code, headers
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
# Update Campaign Send Job
|
1200
|
+
# Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
1201
|
+
# @param id [String] The ID of the currently sending campaign to cancel or revert
|
1202
|
+
# @param campaign_send_job_partial_update_query [CampaignSendJobPartialUpdateQuery] Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT
|
1203
|
+
# @param [Hash] opts the optional parameters
|
1204
|
+
# @return [nil]
|
1205
|
+
def update_campaign_send_job(id, campaign_send_job_partial_update_query, opts = {})
|
1206
|
+
update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update_query, opts)
|
1207
|
+
nil
|
1208
|
+
end
|
1209
|
+
|
1210
|
+
# Update Campaign Send Job
|
1211
|
+
# Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Campaigns Write`
|
1212
|
+
# @param id [String] The ID of the currently sending campaign to cancel or revert
|
1213
|
+
# @param campaign_send_job_partial_update_query [CampaignSendJobPartialUpdateQuery] Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to DRAFT
|
1214
|
+
# @param [Hash] opts the optional parameters
|
1215
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
1216
|
+
def update_campaign_send_job_with_http_info(id, campaign_send_job_partial_update_query, opts = {})
|
1217
|
+
if @api_client.config.debugging
|
1218
|
+
@api_client.config.logger.debug 'Calling API: CampaignsApi.update_campaign_send_job ...'
|
1219
|
+
end
|
1220
|
+
# verify the required parameter 'id' is set
|
1221
|
+
if @api_client.config.client_side_validation && id.nil?
|
1222
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignsApi.update_campaign_send_job"
|
1223
|
+
end
|
1224
|
+
# verify the required parameter 'campaign_send_job_partial_update_query' is set
|
1225
|
+
if @api_client.config.client_side_validation && campaign_send_job_partial_update_query.nil?
|
1226
|
+
fail ArgumentError, "Missing the required parameter 'campaign_send_job_partial_update_query' when calling CampaignsApi.update_campaign_send_job"
|
1227
|
+
end
|
1228
|
+
# resource path
|
1229
|
+
local_var_path = '/api/campaign-send-jobs/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1230
|
+
|
1231
|
+
# query parameters
|
1232
|
+
query_params = opts[:query_params] || {}
|
1233
|
+
|
1234
|
+
# header parameters
|
1235
|
+
header_params = opts[:header_params] || {}
|
1236
|
+
# klaviyo api revision
|
1237
|
+
header_params['revision'] = ENV['API_REVISION'] || "2023-02-22"
|
1238
|
+
# HTTP header 'Accept' (if needed)
|
1239
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1240
|
+
# HTTP header 'Content-Type'
|
1241
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1242
|
+
if !content_type.nil?
|
1243
|
+
header_params['Content-Type'] = content_type
|
1244
|
+
end
|
1245
|
+
|
1246
|
+
# form parameters
|
1247
|
+
form_params = opts[:form_params] || {}
|
1248
|
+
|
1249
|
+
# http body (model)
|
1250
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(campaign_send_job_partial_update_query)
|
1251
|
+
|
1252
|
+
# return_type
|
1253
|
+
return_type = opts[:debug_return_type]
|
1254
|
+
|
1255
|
+
# auth_names
|
1256
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
1257
|
+
|
1258
|
+
new_options = opts.merge(
|
1259
|
+
:operation => :"CampaignsApi.update_campaign_send_job",
|
1260
|
+
:header_params => header_params,
|
1261
|
+
:query_params => query_params,
|
1262
|
+
:form_params => form_params,
|
1263
|
+
:body => post_body,
|
1264
|
+
:auth_names => auth_names,
|
1265
|
+
:return_type => return_type
|
1266
|
+
)
|
1267
|
+
|
1268
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1269
|
+
if @api_client.config.debugging
|
1270
|
+
@api_client.config.logger.debug "API called: CampaignsApi#update_campaign_send_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1271
|
+
end
|
1272
|
+
return data, status_code, headers
|
1273
|
+
end
|
1274
|
+
end
|
1275
|
+
end
|