Class: RecombeeApiClient::UpdatePropertyBasedSegmentation

Inherits:
ApiRequest
  • Object
show all
Defined in:
lib/recombee_api_client/api/update_property_based_segmentation.rb

Overview

Updates a Property Based Segmentation

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_optional

Constructor Details

#initialize(segmentation_id, optional = {}) ⇒ UpdatePropertyBasedSegmentation

  • *Required arguments*

    • segmentation_id -> ID of the updated Segmentation

  • *Optional arguments (given as hash optional)*

    • propertyName -> Name of the property on which the Segmentation should be based

    • title -> Human-readable name that is shown in the Recombee Admin UI.

    • description -> Description that is shown in the Recombee Admin UI.



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 29

def initialize(segmentation_id, optional = {})
  @segmentation_id = segmentation_id
  optional = normalize_optional(optional)
  @property_name = optional['propertyName']
  @title = optional['title']
  @description = optional['description']
  @optional = optional
  @timeout = 10000
  @ensure_https = false
  @optional.each do |par, _|
    fail UnknownOptionalParameter.new(par) unless ["propertyName","title","description"].include? par
  end
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



13
14
15
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 13

def description
  @description
end

#ensure_httpsObject

Returns the value of attribute ensure_https.



15
16
17
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 15

def ensure_https
  @ensure_https
end

#property_nameObject (readonly)

Returns the value of attribute property_name.



13
14
15
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 13

def property_name
  @property_name
end

#segmentation_idObject (readonly)

Returns the value of attribute segmentation_id.



13
14
15
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 13

def segmentation_id
  @segmentation_id
end

#timeoutObject

Returns the value of attribute timeout.



14
15
16
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 14

def timeout
  @timeout
end

#titleObject (readonly)

Returns the value of attribute title.



13
14
15
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 13

def title
  @title
end

Instance Method Details

#body_parametersObject

Values of body parameters as a Hash



49
50
51
52
53
54
55
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 49

def body_parameters
  p = Hash.new
  p['propertyName'] = @optional['propertyName'] if @optional.include? 'propertyName'
  p['title'] = @optional['title'] if @optional.include? 'title'
  p['description'] = @optional['description'] if @optional.include? 'description'
  p
end

#methodObject

HTTP method



44
45
46
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 44

def method
  :post
end

#pathObject

Relative path to the endpoint



65
66
67
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 65

def path
  "/{databaseId}/segmentations/property-based/#{@segmentation_id}"
end

#query_parametersObject

Values of query parameters as a Hash. name of parameter => value of the parameter



59
60
61
62
# File 'lib/recombee_api_client/api/update_property_based_segmentation.rb', line 59

def query_parameters
  params = {}
  params
end