Class: RecombeeApiClient::UpdateManualReqlSegmentation

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

Overview

Update an existing Segmentation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_hash_to_camel_case

Constructor Details

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

  • *Required arguments*

    • segmentation_id -> ID of the updated Segmentation

  • *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.



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/recombee_api_client/api/update_manual_reql_segmentation.rb', line 26

def initialize(segmentation_id, optional = {})
  @segmentation_id = segmentation_id
  optional = normalize_hash_to_camel_case(optional)
  @title = optional['title']
  @description = optional['description']
  @optional = optional
  @timeout = 10_000
  @ensure_https = false
  @optional.each do |par, _|
    raise UnknownOptionalParameter.new(par) unless %w[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_manual_reql_segmentation.rb', line 13

def description
  @description
end

#ensure_httpsObject

Returns the value of attribute ensure_https.



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

def ensure_https
  @ensure_https
end

#segmentation_idObject (readonly)

Returns the value of attribute segmentation_id.



13
14
15
# File 'lib/recombee_api_client/api/update_manual_reql_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_manual_reql_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_manual_reql_segmentation.rb', line 13

def title
  @title
end

Instance Method Details

#body_parametersObject

Values of body parameters as a Hash



45
46
47
48
49
50
51
# File 'lib/recombee_api_client/api/update_manual_reql_segmentation.rb', line 45

def body_parameters
  p = {}
  p['title'] = @optional['title'] if @optional.include? 'title'
  p['description'] = @optional['description'] if @optional.include? 'description'

  p
end

#methodObject

HTTP method



40
41
42
# File 'lib/recombee_api_client/api/update_manual_reql_segmentation.rb', line 40

def method
  :post
end

#pathObject

Relative path to the endpoint



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

def path
  "/{databaseId}/segmentations/manual-reql/#{@segmentation_id}"
end

#query_parametersObject

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



55
56
57
# File 'lib/recombee_api_client/api/update_manual_reql_segmentation.rb', line 55

def query_parameters
  {}
end