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