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_hash_to_camel_case
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 totrue, the item will be created with the same ID as the series. Default istrue.
-
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/recombee_api_client/api/add_series.rb', line 22 def initialize(series_id, optional = {}) @series_id = series_id optional = normalize_hash_to_camel_case(optional) @cascade_create = optional['cascadeCreate'] @optional = optional @timeout = 3000 @ensure_https = false @optional.each do |par, _| raise 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.
13 14 15 |
# File 'lib/recombee_api_client/api/add_series.rb', line 13 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
40 41 42 43 44 45 |
# File 'lib/recombee_api_client/api/add_series.rb', line 40 def body_parameters p = {} p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate' p end |
#method ⇒ Object
HTTP method
35 36 37 |
# File 'lib/recombee_api_client/api/add_series.rb', line 35 def method :put end |
#path ⇒ Object
Relative path to the endpoint
54 55 56 |
# File 'lib/recombee_api_client/api/add_series.rb', line 54 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 |
# File 'lib/recombee_api_client/api/add_series.rb', line 49 def query_parameters {} end |