Class: SuggestGrid::GetRecommendedUsersBody
- Defined in:
- lib/suggestgrid/models/get_recommended_users_body.rb
Overview
Query for recommended users.
Instance Attribute Summary collapse
-
#except ⇒ List of String
These user ids that will not be included in the response.
-
#fields ⇒ List of String
The metadata fields to be included in returned user objects.
-
#filter ⇒ Array<String, Boolean>
Contraints on the returned users or items.
-
#from ⇒ Integer
The number of most recommended items to be skipped from the response.
-
#item_id ⇒ String
The item id of the query.
-
#item_ids ⇒ List of String
The item ids of the query.
-
#similar_user_id ⇒ String
Similar user that the response should be similar to.
-
#similar_user_ids ⇒ List of String
Similar users that the response should be similar to.
-
#size ⇒ Integer
The number of users requested.
-
#type ⇒ String
The type of the query.
-
#types ⇒ List of String
The types of the query.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(type = nil, types = nil, item_id = nil, item_ids = nil, from = nil, size = nil, similar_user_id = nil, similar_user_ids = nil, fields = nil, filter = nil, except = nil) ⇒ GetRecommendedUsersBody
constructor
A new instance of GetRecommendedUsersBody.
Methods inherited from BaseModel
Constructor Details
#initialize(type = nil, types = nil, item_id = nil, item_ids = nil, from = nil, size = nil, similar_user_id = nil, similar_user_ids = nil, fields = nil, filter = nil, except = nil) ⇒ GetRecommendedUsersBody
Returns a new instance of GetRecommendedUsersBody.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 77 def initialize(type = nil, types = nil, item_id = nil, item_ids = nil, from = nil, size = nil, similar_user_id = nil, similar_user_ids = nil, fields = nil, filter = nil, except = nil) @type = type @types = types @item_id = item_id @item_ids = item_ids @from = from @size = size @similar_user_id = similar_user_id @similar_user_ids = similar_user_ids @fields = fields @filter = filter @except = except end |
Instance Attribute Details
#except ⇒ List of String
These user ids that will not be included in the response.
58 59 60 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 58 def except @except end |
#fields ⇒ List of String
The metadata fields to be included in returned user objects.
47 48 49 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 47 def fields @fields end |
#filter ⇒ Array<String, Boolean>
Contraints on the returned users or items. Filter structure is defined in [the filter parameter documentation](www.suggestgrid.com/docs/advanced-features#filters-p arameter).
54 55 56 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 54 def filter @filter end |
#from ⇒ Integer
The number of most recommended items to be skipped from the response. Defaults to 0.
29 30 31 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 29 def from @from end |
#item_id ⇒ String
The item id of the query.
19 20 21 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 19 def item_id @item_id end |
#item_ids ⇒ List of String
The item ids of the query. Exactly one of item id or item ids parameters must be provided.
24 25 26 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 24 def item_ids @item_ids end |
#similar_user_id ⇒ String
Similar user that the response should be similar to.
38 39 40 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 38 def similar_user_id @similar_user_id end |
#similar_user_ids ⇒ List of String
Similar users that the response should be similar to. At most one of similar user and similar users parameters can be provided.
43 44 45 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 43 def similar_user_ids @similar_user_ids end |
#size ⇒ Integer
The number of users requested. Defaults to 10. Must be between 1 and 10,000 inclusive.
34 35 36 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 34 def size @size end |
#type ⇒ String
The type of the query. Recommendations will be calculated based on actions of this type.
10 11 12 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 10 def type @type end |
#types ⇒ List of String
The types of the query. Exactly one of type or types parameters must be provided.
15 16 17 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 15 def types @types end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash['type'] types = hash['types'] item_id = hash['item_id'] item_ids = hash['item_ids'] from = hash['from'] size = hash['size'] similar_user_id = hash['similar_user_id'] similar_user_ids = hash['similar_user_ids'] fields = hash['fields'] filter = hash['filter'] except = hash['except'] # Create object from extracted values. GetRecommendedUsersBody.new(type, types, item_id, item_ids, from, size, similar_user_id, similar_user_ids, fields, filter, except) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/suggestgrid/models/get_recommended_users_body.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['types'] = 'types' @_hash['item_id'] = 'item_id' @_hash['item_ids'] = 'item_ids' @_hash['from'] = 'from' @_hash['size'] = 'size' @_hash['similar_user_id'] = 'similar_user_id' @_hash['similar_user_ids'] = 'similar_user_ids' @_hash['fields'] = 'fields' @_hash['filter'] = 'filter' @_hash['except'] = 'except' @_hash end |