suggestgrid 0.2.0.rc5 → 0.3.0.rc4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/suggestgrid/controllers/action_controller.rb +2 -6
- data/lib/suggestgrid/controllers/type_controller.rb +1 -1
- data/lib/suggestgrid/http/auth/basic_auth.rb +1 -1
- data/lib/suggestgrid/suggestgrid_client.rb +6 -0
- data/lib/suggestgrid.rb +0 -2
- data/spec/swagger.yaml +3 -55
- metadata +3 -5
- data/lib/suggestgrid/exceptions/delete_error_response_error_exception.rb +0 -52
- data/lib/suggestgrid/models/delete_success_response.rb +0 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e37b4b4d76def0d268b4ce74d9b3d8f03dcb318e
|
4
|
+
data.tar.gz: 76b802f74c7b3d85e79418c6040cf34b9ac16a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f360653ded45bf4e32ff76a2e662471181e18fb96c0f3e30073f0960aae22e240400f6f0e3de52ab8b159fd0d389c7addaa4a708c0154d9bfe9cfb711d4a8436
|
7
|
+
data.tar.gz: ae8947b60dd0b76122448e959ecc8d2e7161baa0494e63249348f1b6b256d00a60af4b40640f8776c51734eed7bcc59375365454076748ced4866ea6cbc88f16
|
@@ -144,7 +144,7 @@ module SuggestGrid
|
|
144
144
|
# @param [String] user_id Optional parameter: Delete actions of a user id.
|
145
145
|
# @param [String] item_id Optional parameter: Delete actions of an item id.
|
146
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
|
-
# @return
|
147
|
+
# @return MessageResponse response from the API call
|
148
148
|
def delete_actions(type,
|
149
149
|
user_id = nil,
|
150
150
|
item_id = nil,
|
@@ -174,12 +174,8 @@ module SuggestGrid
|
|
174
174
|
# validate response against endpoint and global error codes
|
175
175
|
if _context.response.status_code == 400
|
176
176
|
raise ErrorResponseErrorException.new 'Required user id or item id parameters are missing.', _context
|
177
|
-
elsif _context.response.status_code == 404
|
178
|
-
raise DeleteErrorResponseErrorException.new 'Delete actions not found.', _context
|
179
177
|
elsif _context.response.status_code == 422
|
180
178
|
raise ErrorResponseErrorException.new 'No query parameter (user id, item id, or older than) is given. qIn order to delete all actionsdelete the type.', _context
|
181
|
-
elsif _context.response.status_code == 505
|
182
|
-
raise ErrorResponseErrorException.new 'Request timed out.', _context
|
183
179
|
elsif !_context.response.status_code.between?(200, 208)
|
184
180
|
raise ErrorResponseErrorException.new 'Unexpected internal error.', _context
|
185
181
|
end
|
@@ -187,7 +183,7 @@ module SuggestGrid
|
|
187
183
|
|
188
184
|
# return appropriate response type
|
189
185
|
decoded = APIHelper.json_deserialize(_context.response.raw_body)
|
190
|
-
return
|
186
|
+
return MessageResponse.from_hash(decoded)
|
191
187
|
end
|
192
188
|
end
|
193
189
|
end
|
@@ -12,7 +12,7 @@ module SuggestGrid
|
|
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
|
15
|
-
def create_type(type,
|
15
|
+
def create_type(type,
|
16
16
|
settings = nil)
|
17
17
|
|
18
18
|
# prepare query url
|
@@ -9,7 +9,7 @@ module SuggestGrid
|
|
9
9
|
def self.apply(http_request)
|
10
10
|
username = Configuration.basic_auth_user_name
|
11
11
|
password = Configuration.basic_auth_password
|
12
|
-
value = Base64.
|
12
|
+
value = Base64.strict_encode64("#{username}:#{password}")
|
13
13
|
header_value = "Basic #{value}"
|
14
14
|
http_request.headers["Authorization"] = header_value
|
15
15
|
end
|
@@ -34,6 +34,12 @@ module SuggestGrid
|
|
34
34
|
SimilarityController.instance
|
35
35
|
end
|
36
36
|
|
37
|
+
# Returns the configuration class for easy access
|
38
|
+
# @return [Configuration] Returns the actual configuration class
|
39
|
+
def config
|
40
|
+
Configuration
|
41
|
+
end
|
42
|
+
|
37
43
|
# Initializer with authentication and configuration parameters
|
38
44
|
def initialize(connection_url)
|
39
45
|
uri = URI(connection_url)
|
data/lib/suggestgrid.rb
CHANGED
@@ -29,7 +29,6 @@ require_relative 'suggestgrid/models/get_similar_users_body.rb'
|
|
29
29
|
require_relative 'suggestgrid/models/get_similar_items_body.rb'
|
30
30
|
require_relative 'suggestgrid/models/message_response.rb'
|
31
31
|
require_relative 'suggestgrid/models/actions_response.rb'
|
32
|
-
require_relative 'suggestgrid/models/delete_success_response.rb'
|
33
32
|
require_relative 'suggestgrid/models/get_types_response.rb'
|
34
33
|
require_relative 'suggestgrid/models/get_type_response.rb'
|
35
34
|
require_relative 'suggestgrid/models/bulk_post_response.rb'
|
@@ -41,7 +40,6 @@ require_relative 'suggestgrid/models/items_response.rb'
|
|
41
40
|
require_relative 'suggestgrid/exceptions/api_exception.rb'
|
42
41
|
require_relative 'suggestgrid/exceptions/error_response_error_exception.rb'
|
43
42
|
require_relative 'suggestgrid/exceptions/limit_exceeded_error_response_error_exception.rb'
|
44
|
-
require_relative 'suggestgrid/exceptions/delete_error_response_error_exception.rb'
|
45
43
|
require_relative 'suggestgrid/exceptions/detailed_error_response_error_exception.rb'
|
46
44
|
|
47
45
|
require_relative 'suggestgrid/configuration.rb'
|
data/spec/swagger.yaml
CHANGED
@@ -2,7 +2,7 @@ swagger: '2.0'
|
|
2
2
|
|
3
3
|
info:
|
4
4
|
title: SuggestGrid
|
5
|
-
version: 0.
|
5
|
+
version: 0.3.0-rc.4
|
6
6
|
description: Personalization made Simple
|
7
7
|
x-codegen-settings:
|
8
8
|
appendContentHeaders: true
|
@@ -396,50 +396,6 @@ definitions:
|
|
396
396
|
type: integer
|
397
397
|
format: int64
|
398
398
|
description: The limit quantity of the account.
|
399
|
-
DeleteErrorResponse:
|
400
|
-
type: object
|
401
|
-
description: Error response with found, deleted, and failed parameters.
|
402
|
-
properties:
|
403
|
-
error_text:
|
404
|
-
type: string
|
405
|
-
description: Message of the response.
|
406
|
-
error_description:
|
407
|
-
type: string
|
408
|
-
description: Description of the response.
|
409
|
-
error_uri:
|
410
|
-
type: string
|
411
|
-
description: The URI of the error for more details.
|
412
|
-
found:
|
413
|
-
type: integer
|
414
|
-
format: int64
|
415
|
-
description: The number of records found.
|
416
|
-
deleted:
|
417
|
-
type: integer
|
418
|
-
format: int64
|
419
|
-
description: The number of records deleted.
|
420
|
-
failed:
|
421
|
-
type: integer
|
422
|
-
format: int64
|
423
|
-
description: The number of records failed to be deleted.
|
424
|
-
DeleteSuccessResponse:
|
425
|
-
type: object
|
426
|
-
description: Successful delete response with found, deleted, and failed parameters.
|
427
|
-
properties:
|
428
|
-
message:
|
429
|
-
type: string
|
430
|
-
description: Message of the response.
|
431
|
-
found:
|
432
|
-
type: integer
|
433
|
-
format: int64
|
434
|
-
description: The number of records found.
|
435
|
-
deleted:
|
436
|
-
type: integer
|
437
|
-
format: int64
|
438
|
-
description: The number of records deleted.
|
439
|
-
failed:
|
440
|
-
type: integer
|
441
|
-
format: int64
|
442
|
-
description: The number of records failed to be deleted.
|
443
399
|
GetTypesResponse:
|
444
400
|
type: object
|
445
401
|
description: Type names response.
|
@@ -787,25 +743,17 @@ paths:
|
|
787
743
|
type: string
|
788
744
|
responses:
|
789
745
|
200:
|
790
|
-
description:
|
746
|
+
description: Delete actions query accepted.
|
791
747
|
schema:
|
792
|
-
$ref: '#/definitions/
|
748
|
+
$ref: '#/definitions/MessageResponse'
|
793
749
|
400:
|
794
750
|
description: Required user id or item id parameters are missing.
|
795
751
|
schema:
|
796
752
|
$ref: '#/definitions/ErrorResponse'
|
797
|
-
404:
|
798
|
-
description: Delete actions not found.
|
799
|
-
schema:
|
800
|
-
$ref: '#/definitions/DeleteErrorResponse'
|
801
753
|
422:
|
802
754
|
description: No query parameter (user id, item id, or older than) is given. qIn order to delete all actionsdelete the type.
|
803
755
|
schema:
|
804
756
|
$ref: '#/definitions/ErrorResponse'
|
805
|
-
505:
|
806
|
-
description: Request timed out.
|
807
|
-
schema:
|
808
|
-
$ref: '#/definitions/ErrorResponse'
|
809
757
|
default:
|
810
758
|
description: Unexpected internal error.
|
811
759
|
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.
|
4
|
+
version: 0.3.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SuggestGrid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -110,7 +110,6 @@ files:
|
|
110
110
|
- lib/suggestgrid/controllers/similarity_controller.rb
|
111
111
|
- lib/suggestgrid/controllers/type_controller.rb
|
112
112
|
- lib/suggestgrid/exceptions/api_exception.rb
|
113
|
-
- lib/suggestgrid/exceptions/delete_error_response_error_exception.rb
|
114
113
|
- lib/suggestgrid/exceptions/detailed_error_response_error_exception.rb
|
115
114
|
- lib/suggestgrid/exceptions/error_response_error_exception.rb
|
116
115
|
- lib/suggestgrid/exceptions/limit_exceeded_error_response_error_exception.rb
|
@@ -127,7 +126,6 @@ files:
|
|
127
126
|
- lib/suggestgrid/models/base_model.rb
|
128
127
|
- lib/suggestgrid/models/bulk_post_error.rb
|
129
128
|
- lib/suggestgrid/models/bulk_post_response.rb
|
130
|
-
- lib/suggestgrid/models/delete_success_response.rb
|
131
129
|
- lib/suggestgrid/models/get_recommended_items_body.rb
|
132
130
|
- lib/suggestgrid/models/get_recommended_users_body.rb
|
133
131
|
- lib/suggestgrid/models/get_similar_items_body.rb
|
@@ -161,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
159
|
version: 1.3.1
|
162
160
|
requirements: []
|
163
161
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.6.
|
162
|
+
rubygems_version: 2.6.12
|
165
163
|
signing_key:
|
166
164
|
specification_version: 4
|
167
165
|
summary: SuggestGrid Ruby SDK
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
-
|
3
|
-
module SuggestGrid
|
4
|
-
class DeleteErrorResponseErrorException < APIException
|
5
|
-
# Message of the response.
|
6
|
-
# @return [String]
|
7
|
-
attr_accessor :error_text
|
8
|
-
|
9
|
-
# Description of the response.
|
10
|
-
# @return [String]
|
11
|
-
attr_accessor :error_description
|
12
|
-
|
13
|
-
# The URI of the error for more details.
|
14
|
-
# @return [String]
|
15
|
-
attr_accessor :error_uri
|
16
|
-
|
17
|
-
# The number of records found.
|
18
|
-
# @return [Long]
|
19
|
-
attr_accessor :found
|
20
|
-
|
21
|
-
# The number of records deleted.
|
22
|
-
# @return [Long]
|
23
|
-
attr_accessor :deleted
|
24
|
-
|
25
|
-
# The number of records failed to be deleted.
|
26
|
-
# @return [Long]
|
27
|
-
attr_accessor :failed
|
28
|
-
|
29
|
-
# The constructor.
|
30
|
-
# @param [String] The reason for raising an exception
|
31
|
-
# @param [HttpContext] The HttpContext of the API call.
|
32
|
-
def initialize(reason, context)
|
33
|
-
super(reason, context)
|
34
|
-
begin
|
35
|
-
hash = APIHelper.json_deserialize(@context.response.raw_body)
|
36
|
-
unbox(hash)
|
37
|
-
rescue TypeError
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Populates this object by extracting properties from a hash.
|
42
|
-
# @param [Hash] The deserialized response sent by the server in the response body.
|
43
|
-
def unbox(hash)
|
44
|
-
@error_text = hash['error_text']
|
45
|
-
@error_description = hash['error_description']
|
46
|
-
@error_uri = hash['error_uri']
|
47
|
-
@found = hash['found']
|
48
|
-
@deleted = hash['deleted']
|
49
|
-
@failed = hash['failed']
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
-
|
3
|
-
module SuggestGrid
|
4
|
-
class DeleteSuccessResponse < BaseModel
|
5
|
-
# Message of the response.
|
6
|
-
# @return [String]
|
7
|
-
attr_accessor :message
|
8
|
-
|
9
|
-
# The number of records found.
|
10
|
-
# @return [Long]
|
11
|
-
attr_accessor :found
|
12
|
-
|
13
|
-
# The number of records deleted.
|
14
|
-
# @return [Long]
|
15
|
-
attr_accessor :deleted
|
16
|
-
|
17
|
-
# The number of records failed to be deleted.
|
18
|
-
# @return [Long]
|
19
|
-
attr_accessor :failed
|
20
|
-
|
21
|
-
# A mapping from model property names to API property names
|
22
|
-
def self.names
|
23
|
-
if @_hash.nil?
|
24
|
-
@_hash = {}
|
25
|
-
@_hash["message"] = "message"
|
26
|
-
@_hash["found"] = "found"
|
27
|
-
@_hash["deleted"] = "deleted"
|
28
|
-
@_hash["failed"] = "failed"
|
29
|
-
end
|
30
|
-
@_hash
|
31
|
-
end
|
32
|
-
|
33
|
-
def initialize(message = nil,
|
34
|
-
found = nil,
|
35
|
-
deleted = nil,
|
36
|
-
failed = nil)
|
37
|
-
@message = message
|
38
|
-
@found = found
|
39
|
-
@deleted = deleted
|
40
|
-
@failed = failed
|
41
|
-
end
|
42
|
-
|
43
|
-
# Creates an instance of the object from a hash
|
44
|
-
def self.from_hash(hash)
|
45
|
-
return nil unless hash
|
46
|
-
|
47
|
-
# Extract variables from the hash
|
48
|
-
message = hash['message']
|
49
|
-
found = hash['found']
|
50
|
-
deleted = hash['deleted']
|
51
|
-
failed = hash['failed']
|
52
|
-
|
53
|
-
# Create object from extracted values
|
54
|
-
DeleteSuccessResponse.new(message,
|
55
|
-
found,
|
56
|
-
deleted,
|
57
|
-
failed)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|