class RecombeeApiClient::CreatePropertyBasedSegmentation
Creates a Segmentation that splits the items into segments based on values of a particular item property.
A segment is created for each unique value of the property. In case of ‘set` properties, a segment is created for each value in the set. Item belongs to all these segments.
Attributes
Public Class Methods
Source
# File lib/recombee_api_client/api/create_property_based_segmentation.rb, line 34 def initialize(segmentation_id, source_type, property_name, optional = {}) @segmentation_id = segmentation_id @source_type = source_type @property_name = property_name optional = normalize_optional(optional) @title = optional['title'] @description = optional['description'] @optional = optional @timeout = 10000 @ensure_https = false @optional.each do |par, _| fail UnknownOptionalParameter.new(par) unless ["title","description"].include? par end end
-
*Required arguments*
-
segmentation_id
-> ID of the newly created Segmentation -
source_type
-> What type of data should be segmented. Currently only ‘items` are supported. -
property_name
-> Name of the property on which the Segmentation should be based
-
-
*Optional arguments (given as hash optional)*
-
title
-> Human-readable name that is shown in the Recombee Admin UI. -
description
-> Description that is shown in the Recombee Admin UI.
-
Public Instance Methods
Source
# File lib/recombee_api_client/api/create_property_based_segmentation.rb, line 55 def body_parameters p = Hash.new p['sourceType'] = @source_type p['propertyName'] = @property_name p['title'] = @optional['title'] if @optional.include? 'title' p['description'] = @optional['description'] if @optional.include? 'description' p end
Values of body parameters as a Hash
Source
# File lib/recombee_api_client/api/create_property_based_segmentation.rb, line 50 def method :put end
HTTP method
Source
# File lib/recombee_api_client/api/create_property_based_segmentation.rb, line 72 def path "/{databaseId}/segmentations/property-based/#{@segmentation_id}" end
Relative path to the endpoint
Source
# File lib/recombee_api_client/api/create_property_based_segmentation.rb, line 66 def query_parameters params = {} params end
Values of query parameters as a Hash. name of parameter => value of the parameter