Class: RecombeeApiClient::AddSeries
- Inherits:
-
ApiRequest
- Object
- ApiRequest
- RecombeeApiClient::AddSeries
- Defined in:
- lib/recombee_api_client/api/add_series.rb
Overview
Creates a new series in the database.
Instance Attribute Summary collapse
-
#cascade_create ⇒ Object
readonly
Returns the value of attribute cascade_create.
-
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
-
#series_id ⇒ Object
readonly
Returns the value of attribute series_id.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#body_parameters ⇒ Object
Values of body parameters as a Hash.
-
#initialize(series_id, optional = {}) ⇒ AddSeries
constructor
-
*Required arguments* -
series_id
-> ID of the series to be created.
-
-
#method ⇒ Object
HTTP method.
-
#path ⇒ Object
Relative path to the endpoint.
-
#query_parameters ⇒ Object
Values of query parameters as a Hash.
Methods included from HashNormalizer
#camelize, #normalize_optional
Constructor Details
#initialize(series_id, optional = {}) ⇒ AddSeries
-
*Required arguments*
-
series_id
-> ID of the series to be created.
-
-
*Optional arguments (given as hash optional)*
-
cascadeCreate
-> If set to ‘true`, the item will be created with the same ID as the series. Default is `true`.
-
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/recombee_api_client/api/add_series.rb', line 23 def initialize(series_id, optional = {}) @series_id = series_id optional = normalize_optional(optional) @cascade_create = optional['cascadeCreate'] @optional = optional @timeout = 3000 @ensure_https = false @optional.each do |par, _| fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par end end |
Instance Attribute Details
#cascade_create ⇒ Object (readonly)
Returns the value of attribute cascade_create.
12 13 14 |
# File 'lib/recombee_api_client/api/add_series.rb', line 12 def cascade_create @cascade_create end |
#ensure_https ⇒ Object
Returns the value of attribute ensure_https.
14 15 16 |
# File 'lib/recombee_api_client/api/add_series.rb', line 14 def ensure_https @ensure_https end |
#series_id ⇒ Object (readonly)
Returns the value of attribute series_id.
12 13 14 |
# File 'lib/recombee_api_client/api/add_series.rb', line 12 def series_id @series_id end |
#timeout ⇒ Object
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/recombee_api_client/api/add_series.rb', line 13 def timeout @timeout end |
Instance Method Details
#body_parameters ⇒ Object
Values of body parameters as a Hash
41 42 43 44 45 |
# File 'lib/recombee_api_client/api/add_series.rb', line 41 def body_parameters p = Hash.new p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate' p end |
#method ⇒ Object
HTTP method
36 37 38 |
# File 'lib/recombee_api_client/api/add_series.rb', line 36 def method :put end |
#path ⇒ Object
Relative path to the endpoint
55 56 57 |
# File 'lib/recombee_api_client/api/add_series.rb', line 55 def path "/{databaseId}/series/#{@series_id}" end |
#query_parameters ⇒ Object
Values of query parameters as a Hash. name of parameter => value of the parameter
49 50 51 52 |
# File 'lib/recombee_api_client/api/add_series.rb', line 49 def query_parameters params = {} params end |