suggestgrid 0.3.0 → 0.5.0.rc3
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/api_helper.rb +146 -54
- data/lib/suggestgrid/configuration.rb +5 -2
- data/lib/suggestgrid/controllers/action_controller.rb +178 -79
- data/lib/suggestgrid/controllers/base_controller.rb +18 -15
- data/lib/suggestgrid/controllers/metadata_controller.rb +313 -171
- data/lib/suggestgrid/controllers/recommendation_controller.rb +75 -35
- data/lib/suggestgrid/controllers/similarity_controller.rb +75 -35
- data/lib/suggestgrid/controllers/type_controller.rb +131 -74
- data/lib/suggestgrid/exceptions/api_exception.rb +4 -2
- data/lib/suggestgrid/exceptions/{detailed_error_response_error_exception.rb → detailed_error_response.rb} +9 -9
- data/lib/suggestgrid/exceptions/{error_response_error_exception.rb → error_response.rb} +9 -9
- data/lib/suggestgrid/exceptions/{limit_exceeded_error_response_error_exception.rb → limit_exceeded_error_response.rb} +9 -9
- data/lib/suggestgrid/http/auth/basic_auth.rb +8 -5
- data/lib/suggestgrid/http/faraday_client.rb +19 -7
- data/lib/suggestgrid/http/http_call_back.rb +11 -6
- data/lib/suggestgrid/http/http_client.rb +50 -32
- data/lib/suggestgrid/http/http_context.rb +5 -2
- data/lib/suggestgrid/http/http_method_enum.rb +6 -2
- data/lib/suggestgrid/http/http_request.rb +7 -3
- data/lib/suggestgrid/http/http_response.rb +3 -1
- data/lib/suggestgrid/models/action.rb +15 -14
- data/lib/suggestgrid/models/actions_response.rb +16 -14
- data/lib/suggestgrid/models/base_model.rb +11 -9
- data/lib/suggestgrid/models/bulk_post_error.rb +11 -11
- data/lib/suggestgrid/models/bulk_post_response.rb +16 -13
- data/lib/suggestgrid/models/get_recommended_items_body.rb +32 -25
- data/lib/suggestgrid/models/get_recommended_users_body.rb +32 -25
- data/lib/suggestgrid/models/get_similar_items_body.rb +33 -24
- data/lib/suggestgrid/models/get_similar_users_body.rb +30 -23
- data/lib/suggestgrid/models/get_type_response.rb +9 -9
- data/lib/suggestgrid/models/get_types_response.rb +9 -9
- data/lib/suggestgrid/models/items_response.rb +16 -14
- data/lib/suggestgrid/models/message_response.rb +9 -9
- data/lib/suggestgrid/models/metadata.rb +9 -8
- data/lib/suggestgrid/models/type_request_body.rb +11 -10
- data/lib/suggestgrid/models/users_response.rb +16 -14
- data/lib/suggestgrid/suggestgrid_client.rb +16 -14
- data/lib/suggestgrid.rb +5 -4
- data/spec/swagger.yaml +3 -3
- metadata +8 -8
@@ -1,17 +1,17 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
2
3
|
|
3
4
|
module SuggestGrid
|
5
|
+
# Basic response with a message for success responses.
|
4
6
|
class MessageResponse < BaseModel
|
5
7
|
# Message of the response.
|
6
8
|
# @return [String]
|
7
9
|
attr_accessor :message
|
8
10
|
|
9
|
-
# A mapping from model property names to API property names
|
11
|
+
# A mapping from model property names to API property names.
|
10
12
|
def self.names
|
11
|
-
if @_hash.nil?
|
12
|
-
|
13
|
-
@_hash["message"] = "message"
|
14
|
-
end
|
13
|
+
@_hash = {} if @_hash.nil?
|
14
|
+
@_hash['message'] = 'message'
|
15
15
|
@_hash
|
16
16
|
end
|
17
17
|
|
@@ -19,14 +19,14 @@ module SuggestGrid
|
|
19
19
|
@message = message
|
20
20
|
end
|
21
21
|
|
22
|
-
# Creates an instance of the object from a hash
|
22
|
+
# Creates an instance of the object from a hash.
|
23
23
|
def self.from_hash(hash)
|
24
24
|
return nil unless hash
|
25
25
|
|
26
|
-
# Extract variables from the hash
|
26
|
+
# Extract variables from the hash.
|
27
27
|
message = hash['message']
|
28
28
|
|
29
|
-
# Create object from extracted values
|
29
|
+
# Create object from extracted values.
|
30
30
|
MessageResponse.new(message)
|
31
31
|
end
|
32
32
|
end
|
@@ -1,30 +1,31 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
2
3
|
|
3
4
|
module SuggestGrid
|
5
|
+
# Metadata of a user or an item. Id parameter is required for all metadata.
|
6
|
+
# Metadata may have other parameters with string, number, or boolean values.
|
4
7
|
class Metadata < BaseModel
|
5
8
|
# The id of the metadata of a user or an item.
|
6
9
|
# @return [String]
|
7
10
|
attr_accessor :id
|
8
11
|
|
9
|
-
# A mapping from model property names to API property names
|
12
|
+
# A mapping from model property names to API property names.
|
10
13
|
def self.names
|
11
|
-
if @_hash.nil?
|
12
|
-
|
13
|
-
@_hash["id"] = "id"
|
14
|
-
end
|
14
|
+
@_hash = {} if @_hash.nil?
|
15
|
+
@_hash['id'] = 'id'
|
15
16
|
@_hash
|
16
17
|
end
|
17
18
|
|
18
19
|
def initialize(hash)
|
19
20
|
if !hash['id']
|
20
|
-
hash['id'] =
|
21
|
+
hash['id'] = nilc
|
21
22
|
end
|
22
23
|
hash.each { |name, value|
|
23
24
|
instance_variable_set("@#{name}", value)
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
27
|
-
# Creates an instance of the object from a hash
|
28
|
+
# Creates an instance of the object from a hash.
|
28
29
|
def self.from_hash(hash)
|
29
30
|
Metadata.new(hash)
|
30
31
|
end
|
@@ -1,17 +1,18 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
2
3
|
|
3
4
|
module SuggestGrid
|
5
|
+
# Options for creating a type.
|
4
6
|
class TypeRequestBody < BaseModel
|
5
|
-
# The rating type of the type. Could be "explicit" or "implicit", where
|
7
|
+
# The rating type of the type. Could be "explicit" or "implicit", where
|
8
|
+
# "implicit" is the default.
|
6
9
|
# @return [String]
|
7
10
|
attr_accessor :rating
|
8
11
|
|
9
|
-
# A mapping from model property names to API property names
|
12
|
+
# A mapping from model property names to API property names.
|
10
13
|
def self.names
|
11
|
-
if @_hash.nil?
|
12
|
-
|
13
|
-
@_hash["rating"] = "rating"
|
14
|
-
end
|
14
|
+
@_hash = {} if @_hash.nil?
|
15
|
+
@_hash['rating'] = 'rating'
|
15
16
|
@_hash
|
16
17
|
end
|
17
18
|
|
@@ -19,14 +20,14 @@ module SuggestGrid
|
|
19
20
|
@rating = rating
|
20
21
|
end
|
21
22
|
|
22
|
-
# Creates an instance of the object from a hash
|
23
|
+
# Creates an instance of the object from a hash.
|
23
24
|
def self.from_hash(hash)
|
24
25
|
return nil unless hash
|
25
26
|
|
26
|
-
# Extract variables from the hash
|
27
|
+
# Extract variables from the hash.
|
27
28
|
rating = hash['rating']
|
28
29
|
|
29
|
-
# Create object from extracted values
|
30
|
+
# Create object from extracted values.
|
30
31
|
TypeRequestBody.new(rating)
|
31
32
|
end
|
32
33
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
2
3
|
|
3
4
|
module SuggestGrid
|
5
|
+
# Get users response.
|
4
6
|
class UsersResponse < BaseModel
|
5
7
|
# The number of users in the response.
|
6
8
|
# @return [Long]
|
@@ -14,14 +16,12 @@ module SuggestGrid
|
|
14
16
|
# @return [List of Metadata]
|
15
17
|
attr_accessor :users
|
16
18
|
|
17
|
-
# A mapping from model property names to API property names
|
19
|
+
# A mapping from model property names to API property names.
|
18
20
|
def self.names
|
19
|
-
if @_hash.nil?
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@_hash["users"] = "users"
|
24
|
-
end
|
21
|
+
@_hash = {} if @_hash.nil?
|
22
|
+
@_hash['count'] = 'count'
|
23
|
+
@_hash['total_count'] = 'total_count'
|
24
|
+
@_hash['users'] = 'users'
|
25
25
|
@_hash
|
26
26
|
end
|
27
27
|
|
@@ -33,21 +33,23 @@ module SuggestGrid
|
|
33
33
|
@users = users
|
34
34
|
end
|
35
35
|
|
36
|
-
# Creates an instance of the object from a hash
|
36
|
+
# Creates an instance of the object from a hash.
|
37
37
|
def self.from_hash(hash)
|
38
38
|
return nil unless hash
|
39
39
|
|
40
|
-
# Extract variables from the hash
|
40
|
+
# Extract variables from the hash.
|
41
41
|
count = hash['count']
|
42
42
|
total_count = hash['total_count']
|
43
43
|
# Parameter is an array, so we need to iterate through it
|
44
44
|
users = nil
|
45
|
-
|
46
|
-
users =
|
47
|
-
hash['users'].each
|
45
|
+
unless hash['users'].nil?
|
46
|
+
users = []
|
47
|
+
hash['users'].each do |structure|
|
48
|
+
users << (Metadata.from_hash(structure) if structure)
|
49
|
+
end
|
48
50
|
end
|
49
51
|
|
50
|
-
# Create object from extracted values
|
52
|
+
# Create object from extracted values.
|
51
53
|
UsersResponse.new(count,
|
52
54
|
total_count,
|
53
55
|
users)
|
@@ -1,46 +1,48 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
2
3
|
|
3
4
|
require 'uri'
|
4
5
|
|
5
6
|
module SuggestGrid
|
7
|
+
# suggest_grid client class.
|
6
8
|
class SuggestGridClient
|
7
|
-
# Singleton access to type controller
|
8
|
-
# @return [TypeController] Returns the controller instance
|
9
|
+
# Singleton access to type controller.
|
10
|
+
# @return [TypeController] Returns the controller instance.
|
9
11
|
def type
|
10
12
|
TypeController.instance
|
11
13
|
end
|
12
14
|
|
13
|
-
# Singleton access to action controller
|
14
|
-
# @return [ActionController] Returns the controller instance
|
15
|
+
# Singleton access to action controller.
|
16
|
+
# @return [ActionController] Returns the controller instance.
|
15
17
|
def action
|
16
18
|
ActionController.instance
|
17
19
|
end
|
18
20
|
|
19
|
-
# Singleton access to metadata controller
|
20
|
-
# @return [MetadataController] Returns the controller instance
|
21
|
+
# Singleton access to metadata controller.
|
22
|
+
# @return [MetadataController] Returns the controller instance.
|
21
23
|
def metadata
|
22
24
|
MetadataController.instance
|
23
25
|
end
|
24
26
|
|
25
|
-
# Singleton access to recommendation controller
|
26
|
-
# @return [RecommendationController] Returns the controller instance
|
27
|
+
# Singleton access to recommendation controller.
|
28
|
+
# @return [RecommendationController] Returns the controller instance.
|
27
29
|
def recommendation
|
28
30
|
RecommendationController.instance
|
29
31
|
end
|
30
32
|
|
31
|
-
# Singleton access to similarity controller
|
32
|
-
# @return [SimilarityController] Returns the controller instance
|
33
|
+
# Singleton access to similarity controller.
|
34
|
+
# @return [SimilarityController] Returns the controller instance.
|
33
35
|
def similarity
|
34
36
|
SimilarityController.instance
|
35
37
|
end
|
36
38
|
|
37
|
-
# Returns the configuration class for easy access
|
38
|
-
# @return [Configuration] Returns the actual configuration class
|
39
|
+
# Returns the configuration class for easy access.
|
40
|
+
# @return [Configuration] Returns the actual configuration class.
|
39
41
|
def config
|
40
42
|
Configuration
|
41
43
|
end
|
42
44
|
|
43
|
-
# Initializer with authentication and configuration parameters
|
45
|
+
# Initializer with authentication and configuration parameters.
|
44
46
|
def initialize(connection_url)
|
45
47
|
uri = URI(connection_url)
|
46
48
|
Configuration.base_uri = "#{uri.scheme}://#{uri.host}:#{uri.port}#{uri.path}"
|
data/lib/suggestgrid.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
2
3
|
require 'date'
|
3
4
|
require 'json'
|
4
5
|
require 'faraday'
|
@@ -38,9 +39,9 @@ require_relative 'suggestgrid/models/items_response.rb'
|
|
38
39
|
|
39
40
|
# Exceptions
|
40
41
|
require_relative 'suggestgrid/exceptions/api_exception.rb'
|
41
|
-
require_relative 'suggestgrid/exceptions/
|
42
|
-
require_relative 'suggestgrid/exceptions/
|
43
|
-
require_relative 'suggestgrid/exceptions/
|
42
|
+
require_relative 'suggestgrid/exceptions/error_response.rb'
|
43
|
+
require_relative 'suggestgrid/exceptions/limit_exceeded_error_response.rb'
|
44
|
+
require_relative 'suggestgrid/exceptions/detailed_error_response.rb'
|
44
45
|
|
45
46
|
require_relative 'suggestgrid/configuration.rb'
|
46
47
|
|
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.5.0-rc.3
|
6
6
|
description: Personalization made Simple
|
7
7
|
x-codegen-settings:
|
8
8
|
appendContentHeaders: true
|
@@ -81,9 +81,9 @@ tags:
|
|
81
81
|
- delete_item
|
82
82
|
- delete_all_items
|
83
83
|
- name: recommendation
|
84
|
-
description:
|
84
|
+
description: Recommendation Methods
|
85
85
|
x-docs-text: |
|
86
|
-
|
86
|
+
Recommendation methods are for getting recommended items for users, or recommended users for items.
|
87
87
|
Refer to [recommendations](http://www.suggestgrid.com/docs/recommendations) for an overview.
|
88
88
|
x-methods:
|
89
89
|
- get_recommended_users
|
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.5.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SuggestGrid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -110,9 +110,9 @@ 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/
|
114
|
-
- lib/suggestgrid/exceptions/
|
115
|
-
- lib/suggestgrid/exceptions/
|
113
|
+
- lib/suggestgrid/exceptions/detailed_error_response.rb
|
114
|
+
- lib/suggestgrid/exceptions/error_response.rb
|
115
|
+
- lib/suggestgrid/exceptions/limit_exceeded_error_response.rb
|
116
116
|
- lib/suggestgrid/http/auth/basic_auth.rb
|
117
117
|
- lib/suggestgrid/http/faraday_client.rb
|
118
118
|
- lib/suggestgrid/http/http_call_back.rb
|
@@ -154,12 +154,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '2.0'
|
155
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 1.3.1
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.6.
|
162
|
+
rubygems_version: 2.6.14
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: SuggestGrid Ruby SDK
|