suggestgrid 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a511c55944959fd302cda98f0de49a47b7e2fc0
4
- data.tar.gz: c07cb656d5bbd87b4ec356c49acea5731381f8b5
3
+ metadata.gz: b3211855090c4d1f0fb3d12de89a3884a3dd8ec4
4
+ data.tar.gz: bad7b0fab8fb56452ae55a707db241d225326c63
5
5
  SHA512:
6
- metadata.gz: 9c8585d8f20f804af0b04d49e36f03f88529983ae0f97f147acc9fbeda9d85064c64b65285b4648cf16b0a93e7aba2606ce84b1511164a30fdd983759fa50b15
7
- data.tar.gz: ecd0386e2c43a5ae9f76a79ee0a6a7b354918baf5c34b23986578b1b0b4ff364a5f75cee958f1f09178bfd0662ec28e31a7c373415f7d0e4afaac81b6da53747
6
+ metadata.gz: a67609fa929ffd16e75f02820bb34af69e844ac6f1ebda4b2fc825de699d19319b8058e0a139f20446d1ce0e6f0b051e514be3663e725f6fb0c6d510549f1f77
7
+ data.tar.gz: d14ea8c2e786c8edc82ae83ad7eae8eeb8ea655786ed71d27762e1dd428c2b080f7f09a1c0562dd339fba0ff3335496964ac391c9ce9cdcd9d76e69c97220357
data/README.md CHANGED
@@ -8,8 +8,6 @@ We will walk through how to get started with SuggestGrid Ruby Client in three st
8
8
 
9
9
  3. [Get recommendations](#3-get-recommendations)
10
10
 
11
- If you did not [sign up for SuggestGrid](https://dashboard.suggestgrid.com/users/sign_up), this is the right time.
12
-
13
11
  ## Getting Started
14
12
 
15
13
  In this guide we will demonstrate how to display personalized recommendations on an existing Ruby project.
@@ -28,23 +26,16 @@ gem 'suggestgrid'
28
26
 
29
27
 
30
28
 
31
- Applications make their API requests to their dedicated sub-domain of `suggestgrid.space`.
32
-
33
- Most endpoints require a username and password for authentication.
34
-
35
- An initial user name and password is given on sign up.
36
-
37
- It is very convenient to configure SuggestGrid by setting an authenticated `SUGGESTGRID_URL` environment variable in the format below:
29
+ Once you [sign up for SuggestGrid](https://dashboard.suggestgrid.com/users/sign_up), you'll see your SUGGESTGRID_URL parameter on the dashboard in the format below:
38
30
 
39
31
  `http://{user}:{pass}@{region}.suggestgrid.space/{app-uuid}`
40
32
 
41
33
  You can authenticate your application using `SUGGESTGRID_URL` environment variable like the example below:
42
34
 
43
35
  ```ruby
44
- sg_uri = ENV['SUGGESTGRID_URL']
36
+ require 'suggest_grid'
45
37
 
46
- # Initialize the SuggestGrid client.
47
- ::SuggestGridClient = SuggestGrid::SuggestGridClient.new sg_uri
38
+ SuggestGridClient = SuggestGrid::SuggestGridClient.new ENV['SUGGESTGRID_URL']
48
39
  ```
49
40
 
50
41
 
@@ -54,11 +45,11 @@ This could be done either from the dashboard or with a snippet like this:
54
45
 
55
46
  ```ruby
56
47
  begin
57
- SuggestGridClient.type.get_type('views')
58
- puts "SuggestGrid type named 'views' already exists, skipping creation."
48
+ SuggestGridClient.type.get_type('views')
49
+ puts "SuggestGrid type named 'views' already exists, skipping creation."
59
50
  rescue SuggestGrid::APIException => e
60
- SuggestGridClient.type.create_type('views')
61
- puts "SuggestGrid type named 'views' is created."
51
+ SuggestGridClient.type.create_type('views', {'rating': 'implicit'})
52
+ puts "Views SuggestGrid type is created."
62
53
  end
63
54
  ```
64
55
 
@@ -67,16 +58,16 @@ This could be done either from the dashboard or with a snippet like this:
67
58
  ### 2. Post actions
68
59
 
69
60
  Once the type exists, let's start posting actions.
70
- We should invoke SuggestGrid client's action.post_action when an user views an item in our application.
61
+ We should invoke SuggestGrid client's SuggestGridClient.action.post_action when an user views an item in our application.
71
62
 
72
63
  We can do this by putting the snippet below on the relevant point:
73
64
 
74
65
  ```ruby
75
66
  # Send action to SuggestGrid.
76
67
  begin
77
- SuggestGridClient.action.post_action(SuggestGrid::Action.new('views',user.id, self.id))
68
+ SuggestGridClient.action.post_action(SuggestGrid::Action.new('views',user.id, self.id))
78
69
  rescue Exception => e
79
- puts "Exception while sending action #{e}"
70
+ puts "Exception while sending action #{e}"
80
71
  end
81
72
  ```
82
73
 
@@ -96,9 +87,9 @@ Once the first model generated for 'views' type, recommendations could be get us
96
87
 
97
88
  ```ruby
98
89
  begin
99
- items_response = SuggestGridClient.recommendation.get_recommended_items({type: 'view', user_id: user.id, size: size})
100
- items_response.items
90
+ items_response = SuggestGridClient.recommendation.get_recommended_items({'type': 'view', 'user_id': user.id, 'size': size})
91
+ items_response.items
101
92
  rescue Exception => e
102
- puts "Exception while getting recommendations #{e}"
93
+ puts "Exception while getting recommendations #{e}"
103
94
  end
104
95
  ```
@@ -8,7 +8,7 @@ module SuggestGrid
8
8
  @@instance
9
9
  end
10
10
 
11
- # Post an Action
11
+ # Posts an Action
12
12
  # @param [Action] action Required parameter: The action to be posted.
13
13
  # @return MessageResponse response from the API call
14
14
  def post_action(action)
@@ -46,7 +46,7 @@ module SuggestGrid
46
46
  return MessageResponse.from_hash(decoded)
47
47
  end
48
48
 
49
- # Post Bulk Actions
49
+ # Posts Actions
50
50
  # @param [Collection] actions Required parameter: List of actions to be posted.
51
51
  # @return BulkPostResponse response from the API call
52
52
  def post_bulk_actions(actions)
@@ -90,11 +90,11 @@ module SuggestGrid
90
90
  return BulkPostResponse.from_hash(decoded)
91
91
  end
92
92
 
93
- # Get Actions
94
- # @param [String] type Optional parameter: The type of the actions.
95
- # @param [String] user_id Optional parameter: The user id of the actions.
96
- # @param [String] item_id Optional parameter: The item id of the actions.
97
- # @param [String] older_than Optional parameter: Maxium timestamp of the actions. Valid times are in form of 1s, 1m, 1h, 1d, 1M, 1y, where 1 can be any integer, or a UNIX timestamp like 1443798195.
93
+ # Gets Actions
94
+ # @param [String] type Optional parameter: Get actions of a type.
95
+ # @param [String] user_id Optional parameter: Get actions of a user id.
96
+ # @param [String] item_id Optional parameter: Get actions of an item id.
97
+ # @param [String] older_than Optional parameter: Get actions older than the given duration, or the given time number. Could be a ISO 8601 duration, or a Unix time number. Specifications are available at https://en.wikipedia.org/wiki/ISO_8601#Durations, or https://en.wikipedia.org/wiki/Unix_time.
98
98
  # @param [Long] size Optional parameter: The number of the users response. Defaults to 10. Must be between 1 and 10,000 inclusive. This parameter must be string represetation of an integer like "1".
99
99
  # @param [Long] from Optional parameter: The number of users to be skipped from the response. Defaults to 0. Must be bigger than or equal to 0. This parameter must be string represetation of an integer like "1".
100
100
  # @return ActionsResponse response from the API call
@@ -140,12 +140,12 @@ module SuggestGrid
140
140
  end
141
141
 
142
142
  # Delete Actions
143
- # @param [String] type Optional parameter: The type of the actions.
144
- # @param [String] user_id Optional parameter: The user id of the actions.
145
- # @param [String] item_id Optional parameter: The item id of the actions.
146
- # @param [String] older_than Optional parameter: Delete all actions of a type older than the given timestamp or time. Valid times are in form of 1s, 1m, 1h, 1d, 1M, 1y, where 1 can be any integer, or a UNIX timestamp like 1443798195.
143
+ # @param [String] type Required parameter: Delete actions of a type. This parameter and at least one other parameter is required.
144
+ # @param [String] user_id Optional parameter: Delete actions of a user id.
145
+ # @param [String] item_id Optional parameter: Delete actions of an item id.
146
+ # @param [String] older_than Optional parameter: Delete actions older than the given duration, or the given time number. Could be a ISO 8601 duration, or a Unix time number. Specifications are available at https://en.wikipedia.org/wiki/ISO_8601#Durations, or https://en.wikipedia.org/wiki/Unix_time.
147
147
  # @return DeleteSuccessResponse response from the API call
148
- def delete_actions(type = nil,
148
+ def delete_actions(type,
149
149
  user_id = nil,
150
150
  item_id = nil,
151
151
  older_than = nil)
@@ -8,7 +8,7 @@ module SuggestGrid
8
8
  @@instance
9
9
  end
10
10
 
11
- # Post a User
11
+ # Posts a User
12
12
  # @param [Metadata] user Required parameter: The metadata to be saved. Metadata format has its restrictions.
13
13
  # @return MessageResponse response from the API call
14
14
  def post_user(user)
@@ -42,7 +42,7 @@ module SuggestGrid
42
42
  return MessageResponse.from_hash(decoded)
43
43
  end
44
44
 
45
- # Post Bulk Users
45
+ # Posts Users
46
46
  # @param [Collection] users Required parameter: List of user metadata, whose size is limited to 10 thousand.
47
47
  # @return BulkPostResponse response from the API call
48
48
  def post_bulk_users(users)
@@ -82,8 +82,8 @@ module SuggestGrid
82
82
  return BulkPostResponse.from_hash(decoded)
83
83
  end
84
84
 
85
- # Get A User
86
- # @param [String] user_id Required parameter: The user id to delete its metadata.
85
+ # Gets A User
86
+ # @param [String] user_id Required parameter: The user id to get its metadata.
87
87
  # @return Metadata response from the API call
88
88
  def get_user(user_id)
89
89
 
@@ -118,7 +118,7 @@ module SuggestGrid
118
118
  return Metadata.from_hash(decoded)
119
119
  end
120
120
 
121
- # Get Users
121
+ # Gets Users
122
122
  # @param [Long] size Optional parameter: The number of the users response. Defaults to 10. Must be between 1 and 10,000 inclusive. This parameter must be string represetation of an integer like "1".
123
123
  # @param [Long] from Optional parameter: The number of users to be skipped from the response. Defaults to 0. Must be bigger than or equal to 0. This parameter must be string represetation of an integer like "1".
124
124
  # @return UsersResponse response from the API call
@@ -155,7 +155,7 @@ module SuggestGrid
155
155
  return UsersResponse.from_hash(decoded)
156
156
  end
157
157
 
158
- # Delete a User
158
+ # Deletes a User
159
159
  # @param [String] user_id Required parameter: The user id to delete its metadata.
160
160
  # @return MessageResponse response from the API call
161
161
  def delete_user(user_id)
@@ -189,7 +189,7 @@ module SuggestGrid
189
189
  return MessageResponse.from_hash(decoded)
190
190
  end
191
191
 
192
- # Delete All Users
192
+ # Deletes All Users
193
193
  # @return MessageResponse response from the API call
194
194
  def delete_all_users
195
195
 
@@ -219,7 +219,7 @@ module SuggestGrid
219
219
  return MessageResponse.from_hash(decoded)
220
220
  end
221
221
 
222
- # Post an Item
222
+ # Posts An Item
223
223
  # @param [Metadata] item Required parameter: The metadata to be saved. Metadata format has its restrictions.
224
224
  # @return MessageResponse response from the API call
225
225
  def post_item(item)
@@ -253,7 +253,7 @@ module SuggestGrid
253
253
  return MessageResponse.from_hash(decoded)
254
254
  end
255
255
 
256
- # Post Bulk Items
256
+ # Posts Items
257
257
  # @param [Collection] items Required parameter: List of item metadata, whose size is limited to 10 thousand.
258
258
  # @return BulkPostResponse response from the API call
259
259
  def post_bulk_items(items)
@@ -293,8 +293,8 @@ module SuggestGrid
293
293
  return BulkPostResponse.from_hash(decoded)
294
294
  end
295
295
 
296
- # Get An Item
297
- # @param [String] item_id Required parameter: The item id to delete its metadata.
296
+ # Gets An Item
297
+ # @param [String] item_id Required parameter: The item id to get its metadata.
298
298
  # @return Metadata response from the API call
299
299
  def get_item(item_id)
300
300
 
@@ -329,7 +329,7 @@ module SuggestGrid
329
329
  return Metadata.from_hash(decoded)
330
330
  end
331
331
 
332
- # Get Items
332
+ # Gets Items
333
333
  # @param [Long] size Optional parameter: The number of the users response. Defaults to 10. Must be between 1 and 10,000 inclusive. This parameter must be string represetation of an integer like "1".
334
334
  # @param [Long] from Optional parameter: The number of users to be skipped from the response. Defaults to 0. Must be bigger than or equal to 0. This parameter must be string represetation of an integer like "1".
335
335
  # @return ItemsResponse response from the API call
@@ -400,7 +400,7 @@ module SuggestGrid
400
400
  return MessageResponse.from_hash(decoded)
401
401
  end
402
402
 
403
- # Delete All Items
403
+ # Deletes All Items
404
404
  # @return MessageResponse response from the API call
405
405
  def delete_all_items
406
406
 
@@ -8,7 +8,7 @@ module SuggestGrid
8
8
  @@instance
9
9
  end
10
10
 
11
- # Get Recommended Users
11
+ # Gets Recommended Users
12
12
  # @param [GetRecommendedUsersBody] query Required parameter: Query for recommended users.
13
13
  # @return UsersResponse response from the API call
14
14
  def get_recommended_users(query)
@@ -32,6 +32,8 @@ module SuggestGrid
32
32
  # validate response against endpoint and global error codes
33
33
  if _context.response.status_code == 400
34
34
  raise ErrorResponseException.new 'Request body is invalid.', _context
35
+ elsif _context.response.status_code == 404
36
+ raise ErrorResponseException.new 'At least one type in the request does not exist.', _context
35
37
  elsif _context.response.status_code == 422
36
38
  raise ErrorResponseException.new 'Required parameters are missing.', _context
37
39
  elsif !_context.response.status_code.between?(200, 208)
@@ -44,7 +46,7 @@ module SuggestGrid
44
46
  return UsersResponse.from_hash(decoded)
45
47
  end
46
48
 
47
- # Get Recommended Items
49
+ # Gets Recommended Items
48
50
  # @param [GetRecommendedItemsBody] query Required parameter: Query for recommended items.
49
51
  # @return ItemsResponse response from the API call
50
52
  def get_recommended_items(query)
@@ -68,6 +70,8 @@ module SuggestGrid
68
70
  # validate response against endpoint and global error codes
69
71
  if _context.response.status_code == 400
70
72
  raise ErrorResponseException.new 'Request body is invalid.', _context
73
+ elsif _context.response.status_code == 404
74
+ raise ErrorResponseException.new 'At least one type in the request does not exist.', _context
71
75
  elsif _context.response.status_code == 422
72
76
  raise ErrorResponseException.new 'Required parameters are missing.', _context
73
77
  elsif !_context.response.status_code.between?(200, 208)
@@ -8,7 +8,7 @@ module SuggestGrid
8
8
  @@instance
9
9
  end
10
10
 
11
- # Get Similar Users
11
+ # Gets Similar Users
12
12
  # @param [GetSimilarUsersBody] query Required parameter: Query for similar users.
13
13
  # @return UsersResponse response from the API call
14
14
  def get_similar_users(query)
@@ -32,6 +32,8 @@ module SuggestGrid
32
32
  # validate response against endpoint and global error codes
33
33
  if _context.response.status_code == 400
34
34
  raise ErrorResponseException.new 'Request body is invalid.', _context
35
+ elsif _context.response.status_code == 404
36
+ raise ErrorResponseException.new 'At least one type in the request does not exist.', _context
35
37
  elsif _context.response.status_code == 422
36
38
  raise ErrorResponseException.new 'Required parameters are missing.', _context
37
39
  elsif !_context.response.status_code.between?(200, 208)
@@ -44,7 +46,7 @@ module SuggestGrid
44
46
  return UsersResponse.from_hash(decoded)
45
47
  end
46
48
 
47
- # Get Similar Items
49
+ # Gets Similar Items
48
50
  # @param [GetSimilarItemsBody] query Required parameter: Query for similar items.
49
51
  # @return ItemsResponse response from the API call
50
52
  def get_similar_items(query)
@@ -68,6 +70,8 @@ module SuggestGrid
68
70
  # validate response against endpoint and global error codes
69
71
  if _context.response.status_code == 400
70
72
  raise ErrorResponseException.new 'Request body is invalid.', _context
73
+ elsif _context.response.status_code == 404
74
+ raise ErrorResponseException.new 'At least one type in the request does not exist.', _context
71
75
  elsif _context.response.status_code == 422
72
76
  raise ErrorResponseException.new 'Required parameters are missing.', _context
73
77
  elsif !_context.response.status_code.between?(200, 208)
@@ -8,7 +8,7 @@ module SuggestGrid
8
8
  @@instance
9
9
  end
10
10
 
11
- # Create a New Type
11
+ # Creates a Type
12
12
  # @param [String] type Required parameter: The name of the type.
13
13
  # @param [TypeRequestBody] settings Optional parameter: Optional settings for the rating parameter.
14
14
  # @return MessageResponse response from the API call
@@ -51,7 +51,7 @@ module SuggestGrid
51
51
  return MessageResponse.from_hash(decoded)
52
52
  end
53
53
 
54
- # Get Properties of a Type
54
+ # Gets Properties of a Type
55
55
  # @param [String] type Required parameter: The name of the type to get properties.
56
56
  # @return GetTypeResponse response from the API call
57
57
  def get_type(type)
@@ -87,7 +87,7 @@ module SuggestGrid
87
87
  return GetTypeResponse.from_hash(decoded)
88
88
  end
89
89
 
90
- # Delete a Type
90
+ # Deletes a Type
91
91
  # @param [String] type Required parameter: The name of the type to be deleted.
92
92
  # @return MessageResponse response from the API call
93
93
  def delete_type(type)
@@ -123,7 +123,7 @@ module SuggestGrid
123
123
  return MessageResponse.from_hash(decoded)
124
124
  end
125
125
 
126
- # Get All Types
126
+ # Gets All Types
127
127
  # @return GetTypesResponse response from the API call
128
128
  def get_all_types
129
129
 
@@ -153,7 +153,7 @@ module SuggestGrid
153
153
  return GetTypesResponse.from_hash(decoded)
154
154
  end
155
155
 
156
- # Delete All Types
156
+ # Deletes All Types
157
157
  # @return MessageResponse response from the API call
158
158
  def delete_all_types
159
159
 
@@ -14,7 +14,7 @@ module SuggestGrid
14
14
  # @return [String]
15
15
  attr_accessor :error_uri
16
16
 
17
- # Specific details of the response.
17
+ # Details of the response.
18
18
  # @return [String]
19
19
  attr_accessor :error_details
20
20
 
data/spec/swagger.yaml CHANGED
@@ -1,8 +1,8 @@
1
1
  swagger: '2.0'
2
-
2
+ #
3
3
  info:
4
4
  title: SuggestGrid
5
- version: 0.1.30
5
+ version: 0.1.31
6
6
  description: Personalization made Simple
7
7
  x-codegen-settings:
8
8
  appendContentHeaders: true
@@ -43,8 +43,8 @@ tags:
43
43
  - name: type
44
44
  description: Type Methods
45
45
  x-docs-text: |
46
- Type methods are used for creating, inspecting, and deleting SuggestGrid types.
47
- [Types documentation](http://www.suggestgrid.com/docs/types) is available for an overview.
46
+ Type methods are used for creating, getting, and deleting types.
47
+ Refer to [types](http://www.suggestgrid.com/docs/types) for an overview.
48
48
  x-methods:
49
49
  - create_type
50
50
  - get_type
@@ -54,8 +54,8 @@ tags:
54
54
  - name: action
55
55
  description: Action Methods
56
56
  x-docs-text: |
57
- Action methods are for creating, inspecting, and deleting actions.
58
- [Actions documentation](http://www.suggestgrid.com/docs/actions) is available for an overview.
57
+ Action methods are for creating, getting, and deleting actions.
58
+ Refer to [actions](http://www.suggestgrid.com/docs/actions) for an overview.
59
59
  x-methods:
60
60
  - post_action
61
61
  - post_bulk_actions
@@ -64,8 +64,8 @@ tags:
64
64
  - name: metadata
65
65
  description: Metadata Methods
66
66
  x-docs-text: |
67
- Metadata methods are for creating, inspecting, and deleting metadata.
68
- [Metadata documentation ](http://www.suggestgrid.com/docs/metadata) is available for an overview.
67
+ Metadata methods are for creating, getting, and deleting user, and item metadata.
68
+ Refer to [metadata](http://www.suggestgrid.com/docs/metadata) for an overview.
69
69
  x-methods:
70
70
  - post_user
71
71
  - post_bulk_users
@@ -82,16 +82,16 @@ tags:
82
82
  - name: recommendation
83
83
  description: Recommnedation Methods
84
84
  x-docs-text: |
85
- Recommnedation methods are for getting recommended items, or recommended users from SuggestGrid.
86
- [Recommendations documentation](http://www.suggestgrid.com/docs/recommendations) is available for an overview.
85
+ Recommnedation methods are for getting recommended items for users, or recommended users for items.
86
+ Refer to [recommendations](http://www.suggestgrid.com/docs/recommendations) for an overview.
87
87
  x-methods:
88
88
  - get_recommended_users
89
89
  - get_recommended_items
90
90
  - name: similarity
91
91
  description: Similarity Methods
92
92
  x-docs-text: |
93
- Similarity methods are for getting similar items, or similar users from SuggestGrid.
94
- [Similarities documentation](http://www.suggestgrid.com/docs/similarities) is available for an overview.
93
+ Similarity methods are for getting similar items, or similar users.
94
+ Refer to [similarities](http://www.suggestgrid.com/docs/similarities) for an overview.
95
95
  x-methods:
96
96
  - get_similar_users
97
97
  - get_similar_items
@@ -329,7 +329,7 @@ definitions:
329
329
  # Responses
330
330
  MessageResponse:
331
331
  type: object
332
- description: A basic response.
332
+ description: Basic response with a message for success responses.
333
333
  properties:
334
334
  message:
335
335
  type: string
@@ -378,7 +378,7 @@ definitions:
378
378
  description: The URI of the error for more details.
379
379
  error_details:
380
380
  type: string
381
- description: Specific details of the response.
381
+ description: Details of the response.
382
382
  LimitExceededErrorResponse:
383
383
  type: object
384
384
  description: Error response.
@@ -526,7 +526,7 @@ paths:
526
526
  tags:
527
527
  - type
528
528
  operationId: get_all_types
529
- summary: Get All Types
529
+ summary: Gets All Types
530
530
  description: Returns all type names in an array named types.
531
531
  responses:
532
532
  200:
@@ -541,7 +541,7 @@ paths:
541
541
  tags:
542
542
  - type
543
543
  operationId: delete_all_types
544
- summary: Delete All Types
544
+ summary: Deletes All Types
545
545
  description: Deletes ALL the types and ALL the actions.
546
546
  responses:
547
547
  200:
@@ -557,7 +557,7 @@ paths:
557
557
  tags:
558
558
  - type
559
559
  operationId: get_type
560
- summary: Get Properties of a Type
560
+ summary: Gets Properties of a Type
561
561
  description: Returns the options of a type. The response rating parameter.
562
562
  parameters:
563
563
  - name: type
@@ -583,7 +583,7 @@ paths:
583
583
  tags:
584
584
  - type
585
585
  operationId: create_type
586
- summary: Create a New Type
586
+ summary: Creates a Type
587
587
  description: Creates a new type.
588
588
  parameters:
589
589
  - name: type
@@ -623,7 +623,7 @@ paths:
623
623
  tags:
624
624
  - type
625
625
  operationId: delete_type
626
- summary: Delete a Type
626
+ summary: Deletes a Type
627
627
  description: |
628
628
  Warning: Deletes the type with all of its actions and its recommendation model.
629
629
  parameters:
@@ -652,7 +652,7 @@ paths:
652
652
  tags:
653
653
  - action
654
654
  operationId: post_action
655
- summary: Post an Action
655
+ summary: Posts an Action
656
656
  description: |
657
657
  Posts an action to the given type in the body.
658
658
  The body must have user id, item id and type.
@@ -689,7 +689,7 @@ paths:
689
689
  tags:
690
690
  - action
691
691
  operationId: get_actions
692
- summary: Get Actions
692
+ summary: Gets Actions
693
693
  description: |
694
694
  Get actions. Defaut responses will be paged by 10 actios each.
695
695
  Type, user id, item id, or older than parameters could be provided.
@@ -697,27 +697,28 @@ paths:
697
697
  parameters:
698
698
  - name: type
699
699
  in: query
700
- description: The type of the actions.
700
+ description: Get actions of a type.
701
701
  required: false
702
702
  type: string
703
703
  format: id
704
704
  - name: user_id
705
705
  in: query
706
- description: The user id of the actions.
706
+ description: Get actions of a user id.
707
707
  required: false
708
708
  type: string
709
709
  format: id
710
710
  - name: item_id
711
711
  in: query
712
- description: The item id of the actions.
712
+ description: Get actions of an item id.
713
713
  required: false
714
714
  type: string
715
715
  format: id
716
716
  - name: older_than
717
717
  in: query
718
718
  description: |
719
- Maxium timestamp of the actions.
720
- Valid times are in form of 1s, 1m, 1h, 1d, 1M, 1y, where 1 can be any integer, or a UNIX timestamp like 1443798195.
719
+ Get actions older than the given duration, or the given time number.
720
+ Could be a ISO 8601 duration, or a Unix time number.
721
+ Specifications are available at https://en.wikipedia.org/wiki/ISO_8601#Durations, or https://en.wikipedia.org/wiki/Unix_time.
721
722
  required: false
722
723
  type: string
723
724
  - name: size
@@ -764,27 +765,28 @@ paths:
764
765
  parameters:
765
766
  - name: type
766
767
  in: query
767
- description: The type of the actions.
768
- required: false
768
+ description: Delete actions of a type. This parameter and at least one other parameter is required.
769
+ required: true
769
770
  type: string
770
771
  format: id
771
772
  - name: user_id
772
773
  in: query
773
- description: The user id of the actions.
774
+ description: Delete actions of a user id.
774
775
  required: false
775
776
  type: string
776
777
  format: id
777
778
  - name: item_id
778
779
  in: query
779
- description: The item id of the actions.
780
+ description: Delete actions of an item id.
780
781
  required: false
781
782
  type: string
782
783
  format: id
783
784
  - name: older_than
784
785
  in: query
785
786
  description: |
786
- Delete all actions of a type older than the given timestamp or time.
787
- Valid times are in form of 1s, 1m, 1h, 1d, 1M, 1y, where 1 can be any integer, or a UNIX timestamp like 1443798195.
787
+ Delete actions older than the given duration, or the given time number.
788
+ Could be a ISO 8601 duration, or a Unix time number.
789
+ Specifications are available at https://en.wikipedia.org/wiki/ISO_8601#Durations, or https://en.wikipedia.org/wiki/Unix_time.
788
790
  required: false
789
791
  type: string
790
792
  responses:
@@ -817,7 +819,7 @@ paths:
817
819
  tags:
818
820
  - action
819
821
  operationId: post_bulk_actions
820
- summary: Post Bulk Actions
822
+ summary: Posts Actions
821
823
  description: |
822
824
  Posts bulk actions to SuggestGrid.
823
825
  The recommended method for posting multiple actions at once.
@@ -860,19 +862,19 @@ paths:
860
862
  $ref: '#/definitions/ErrorResponse'
861
863
  # Metadata Paths
862
864
  /v1/users/{user_id}:
863
- parameters:
864
- - name: user_id
865
- in: path
866
- description: The user id to delete its metadata.
867
- required: true
868
- type: string
869
- format: id
870
865
  get:
871
866
  tags:
872
867
  - metadata
873
868
  operationId: get_user
874
- summary: Get A User
869
+ summary: Gets A User
875
870
  description: Returns a user metadata if it exists.
871
+ parameters:
872
+ - name: user_id
873
+ in: path
874
+ description: The user id to get its metadata.
875
+ required: true
876
+ type: string
877
+ format: id
876
878
  responses:
877
879
  200:
878
880
  description: Returns a user metadata.
@@ -890,8 +892,15 @@ paths:
890
892
  tags:
891
893
  - metadata
892
894
  operationId: delete_user
893
- summary: Delete a User
895
+ summary: Deletes a User
894
896
  description: Deletes a user metadata with the given user id.
897
+ parameters:
898
+ - name: user_id
899
+ in: path
900
+ description: The user id to delete its metadata.
901
+ required: true
902
+ type: string
903
+ format: id
895
904
  responses:
896
905
  200:
897
906
  description: Deleted a user metadata.
@@ -906,8 +915,10 @@ paths:
906
915
  tags:
907
916
  - metadata
908
917
  operationId: post_user
909
- summary: Post a User
910
- description: Posts a user metadata.
918
+ summary: Posts a User
919
+ description: |
920
+ Posts a user metadata.
921
+ Note that this operation completely overrides previous metadata for the id, if it exists.
911
922
  parameters:
912
923
  - name: user
913
924
  in: body
@@ -932,7 +943,7 @@ paths:
932
943
  tags:
933
944
  - metadata
934
945
  operationId: get_users
935
- summary: Get Users
946
+ summary: Gets Users
936
947
  description: |
937
948
  Get items and total count of items.
938
949
  Page and per-page parameters could be set.
@@ -968,7 +979,7 @@ paths:
968
979
  tags:
969
980
  - metadata
970
981
  operationId: delete_all_users
971
- summary: Delete All Users
982
+ summary: Deletes All Users
972
983
  description: |
973
984
  Warning: Deletes all user metadata from SuggestGrid.
974
985
  responses:
@@ -981,19 +992,19 @@ paths:
981
992
  schema:
982
993
  $ref: '#/definitions/ErrorResponse'
983
994
  /v1/items/{item_id}:
984
- parameters:
985
- - name: item_id
986
- in: path
987
- description: The item id to delete its metadata.
988
- required: true
989
- type: string
990
- format: id
991
995
  get:
992
996
  tags:
993
997
  - metadata
994
998
  operationId: get_item
995
- summary: Get An Item
999
+ summary: Gets An Item
996
1000
  description: Returns an item metadata if it exists.
1001
+ parameters:
1002
+ - name: item_id
1003
+ in: path
1004
+ description: The item id to get its metadata.
1005
+ required: true
1006
+ type: string
1007
+ format: id
997
1008
  responses:
998
1009
  200:
999
1010
  description: Returns an item metadata.
@@ -1013,6 +1024,13 @@ paths:
1013
1024
  operationId: delete_item
1014
1025
  summary: Delete An Item
1015
1026
  description: Deletes an item metadata with the given item id.
1027
+ parameters:
1028
+ - name: item_id
1029
+ in: path
1030
+ description: The item id to delete its metadata.
1031
+ required: true
1032
+ type: string
1033
+ format: id
1016
1034
  responses:
1017
1035
  200:
1018
1036
  description: Deleted an item metadata.
@@ -1027,10 +1045,10 @@ paths:
1027
1045
  tags:
1028
1046
  - metadata
1029
1047
  operationId: post_item
1030
- summary: Post an Item
1048
+ summary: Posts An Item
1031
1049
  description: |
1032
1050
  Posts an item metadata.
1033
- This metadata can be used to filter or to be included in recommendations and similars methods.
1051
+ Note that this operation completely overrides previous metadata for the id, if it exists.
1034
1052
  parameters:
1035
1053
  - name: item
1036
1054
  in: body
@@ -1055,9 +1073,9 @@ paths:
1055
1073
  tags:
1056
1074
  - metadata
1057
1075
  operationId: get_items
1058
- summary: Get Items
1076
+ summary: Gets Items
1059
1077
  description: |
1060
- Get items and total count of items.
1078
+ Gets items and total count of items.
1061
1079
  Page and per-page parameters could be set.
1062
1080
  parameters:
1063
1081
  - name: size
@@ -1091,7 +1109,7 @@ paths:
1091
1109
  tags:
1092
1110
  - metadata
1093
1111
  operationId: delete_all_items
1094
- summary: Delete All Items
1112
+ summary: Deletes All Items
1095
1113
  description: |
1096
1114
  Warning: Deletes all item metadata from SuggestGrid.
1097
1115
  responses:
@@ -1108,10 +1126,10 @@ paths:
1108
1126
  tags:
1109
1127
  - metadata
1110
1128
  operationId: post_bulk_users
1111
- summary: Post Bulk Users
1129
+ summary: Posts Users
1112
1130
  description: |
1113
- Post user metadata in bulk.
1114
- This metadata can be used to filter or to be included in recommendations and similars methods.
1131
+ Posts user metadata in bulk.
1132
+ Note that this operation completely overrides metadata with the same ids, if they exist.
1115
1133
  consumes:
1116
1134
  - text/plain; charset=utf-8
1117
1135
  parameters:
@@ -1147,10 +1165,10 @@ paths:
1147
1165
  tags:
1148
1166
  - metadata
1149
1167
  operationId: post_bulk_items
1150
- summary: Post Bulk Items
1168
+ summary: Posts Items
1151
1169
  description: |
1152
- Post item metadata in bulk.
1153
- This method is recommended for sharing stored data with SuggestGrid.
1170
+ Posts item metadata in bulk.
1171
+ Note that this operation completely overrides metadata with the same ids, if they exist.
1154
1172
  consumes:
1155
1173
  - text/plain; charset=utf-8
1156
1174
  parameters:
@@ -1187,7 +1205,7 @@ paths:
1187
1205
  tags:
1188
1206
  - recommendation
1189
1207
  operationId: get_recommended_users
1190
- summary: Get Recommended Users
1208
+ summary: Gets Recommended Users
1191
1209
  description: Returns recommended users for the query.
1192
1210
  parameters:
1193
1211
  - name: query
@@ -1205,6 +1223,10 @@ paths:
1205
1223
  description: Request body is invalid.
1206
1224
  schema:
1207
1225
  $ref: '#/definitions/ErrorResponse'
1226
+ 404:
1227
+ description: At least one type in the request does not exist.
1228
+ schema:
1229
+ $ref: '#/definitions/ErrorResponse'
1208
1230
  422:
1209
1231
  description: Required parameters are missing.
1210
1232
  schema:
@@ -1218,7 +1240,7 @@ paths:
1218
1240
  tags:
1219
1241
  - recommendation
1220
1242
  operationId: get_recommended_items
1221
- summary: Get Recommended Items
1243
+ summary: Gets Recommended Items
1222
1244
  description: Returns recommended items for the query.
1223
1245
  parameters:
1224
1246
  - name: query
@@ -1236,6 +1258,10 @@ paths:
1236
1258
  description: Request body is invalid.
1237
1259
  schema:
1238
1260
  $ref: '#/definitions/ErrorResponse'
1261
+ 404:
1262
+ description: At least one type in the request does not exist.
1263
+ schema:
1264
+ $ref: '#/definitions/ErrorResponse'
1239
1265
  422:
1240
1266
  description: Required parameters are missing.
1241
1267
  schema:
@@ -1250,7 +1276,7 @@ paths:
1250
1276
  tags:
1251
1277
  - similarity
1252
1278
  operationId: get_similar_users
1253
- summary: Get Similar Users
1279
+ summary: Gets Similar Users
1254
1280
  description: Returns similar users for the query.
1255
1281
  parameters:
1256
1282
  - name: query
@@ -1268,6 +1294,10 @@ paths:
1268
1294
  description: Request body is invalid.
1269
1295
  schema:
1270
1296
  $ref: '#/definitions/ErrorResponse'
1297
+ 404:
1298
+ description: At least one type in the request does not exist.
1299
+ schema:
1300
+ $ref: '#/definitions/ErrorResponse'
1271
1301
  422:
1272
1302
  description: Required parameters are missing.
1273
1303
  schema:
@@ -1281,7 +1311,7 @@ paths:
1281
1311
  tags:
1282
1312
  - similarity
1283
1313
  operationId: get_similar_items
1284
- summary: Get Similar Items
1314
+ summary: Gets Similar Items
1285
1315
  description: Returns similar items for the query.
1286
1316
  parameters:
1287
1317
  - name: query
@@ -1299,6 +1329,10 @@ paths:
1299
1329
  description: Request body is invalid.
1300
1330
  schema:
1301
1331
  $ref: '#/definitions/ErrorResponse'
1332
+ 404:
1333
+ description: At least one type in the request does not exist.
1334
+ schema:
1335
+ $ref: '#/definitions/ErrorResponse'
1302
1336
  422:
1303
1337
  description: Required parameters are missing.
1304
1338
  schema:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suggestgrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - SuggestGrid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-19 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging