suggestgrid 0.1.15.pre.SNAPSHOT

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.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +104 -0
  4. data/lib/suggest_grid/api_helper.rb +151 -0
  5. data/lib/suggest_grid/configuration.rb +21 -0
  6. data/lib/suggest_grid/controllers/action_controller.rb +257 -0
  7. data/lib/suggest_grid/controllers/base_controller.rb +20 -0
  8. data/lib/suggest_grid/controllers/metadata_controller.rb +527 -0
  9. data/lib/suggest_grid/controllers/recommendation_controller.rb +119 -0
  10. data/lib/suggest_grid/controllers/similarity_controller.rb +119 -0
  11. data/lib/suggest_grid/controllers/type_controller.rb +280 -0
  12. data/lib/suggest_grid/exceptions/api_exception.rb +16 -0
  13. data/lib/suggest_grid/http/http_call_back.rb +17 -0
  14. data/lib/suggest_grid/http/http_client.rb +112 -0
  15. data/lib/suggest_grid/http/http_context.rb +15 -0
  16. data/lib/suggest_grid/http/http_method_enum.rb +7 -0
  17. data/lib/suggest_grid/http/http_request.rb +28 -0
  18. data/lib/suggest_grid/http/http_response.rb +19 -0
  19. data/lib/suggest_grid/http/unirest_client.rb +41 -0
  20. data/lib/suggest_grid/models/action.rb +66 -0
  21. data/lib/suggest_grid/models/bulk_schema_error_response.rb +53 -0
  22. data/lib/suggest_grid/models/count_response.rb +39 -0
  23. data/lib/suggest_grid/models/error_response.rb +48 -0
  24. data/lib/suggest_grid/models/get_recommended_items_body.rb +111 -0
  25. data/lib/suggest_grid/models/get_recommended_users_body.rb +111 -0
  26. data/lib/suggest_grid/models/get_similar_items_body.rb +102 -0
  27. data/lib/suggest_grid/models/get_similar_users_body.rb +102 -0
  28. data/lib/suggest_grid/models/get_type_response.rb +39 -0
  29. data/lib/suggest_grid/models/get_types_response.rb +48 -0
  30. data/lib/suggest_grid/models/items_response.rb +53 -0
  31. data/lib/suggest_grid/models/message_response.rb +39 -0
  32. data/lib/suggest_grid/models/metadata.rb +39 -0
  33. data/lib/suggest_grid/models/metadata_information_response.rb +39 -0
  34. data/lib/suggest_grid/models/schema_error_response.rb +57 -0
  35. data/lib/suggest_grid/models/type_request_body.rb +40 -0
  36. data/lib/suggest_grid/models/users_response.rb +53 -0
  37. data/lib/suggest_grid/suggest_grid_client.rb +47 -0
  38. data/lib/suggest_grid.rb +48 -0
  39. data/spec/swagger.yaml +1169 -0
  40. metadata +123 -0
@@ -0,0 +1,48 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class GetTypesResponse
5
+ # The list of type names
6
+ # @return [List of String]
7
+ attr_accessor :types
8
+
9
+ # Status code of the response. It is not 2XX.
10
+ # @return [Integer]
11
+ attr_accessor :status
12
+
13
+ def initialize(types = nil,
14
+ status = nil)
15
+ @types = types
16
+ @status = status
17
+
18
+ end
19
+
20
+ # Creates JSON of the curent object
21
+ def to_json(options = {})
22
+ hash = key_map
23
+ hash.to_json(options)
24
+ end
25
+
26
+ # Creates an instance of the object from a hash
27
+ def self.from_hash(hash)
28
+ if hash == nil
29
+ nil
30
+ else
31
+ # Extract variables from the hash
32
+ types = hash["types"]
33
+ status = hash["status"]
34
+ # Create object from extracted values
35
+ GetTypesResponse.new(types,
36
+ status)
37
+ end
38
+ end
39
+
40
+ # Defines the key map for json serialization
41
+ def key_map
42
+ hash = {}
43
+ hash['types'] = types
44
+ hash['status'] = status
45
+ hash
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,53 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class ItemsResponse
5
+ # The number of items in the response.
6
+ # @return [Long]
7
+ attr_accessor :count
8
+
9
+ # The number of items in the response.
10
+ # @return [List of Metadata]
11
+ attr_accessor :items
12
+
13
+ def initialize(count = nil,
14
+ items = nil)
15
+ @count = count
16
+ @items = items
17
+
18
+ end
19
+
20
+ # Creates JSON of the curent object
21
+ def to_json(options = {})
22
+ hash = key_map
23
+ hash.to_json(options)
24
+ end
25
+
26
+ # Creates an instance of the object from a hash
27
+ def self.from_hash(hash)
28
+ if hash == nil
29
+ nil
30
+ else
31
+ # Extract variables from the hash
32
+ count = hash["count"]
33
+ # Parameter is an array, so we need to iterate through it
34
+ items = nil
35
+ if hash["items"] != nil
36
+ items = Array.new
37
+ hash["items"].each{|structure| items << (Metadata.from_hash(structure) if structure)}
38
+ end
39
+ # Create object from extracted values
40
+ ItemsResponse.new(count,
41
+ items)
42
+ end
43
+ end
44
+
45
+ # Defines the key map for json serialization
46
+ def key_map
47
+ hash = {}
48
+ hash['count'] = count
49
+ hash['items'] = items ? items.map(&:key_map) : nil
50
+ hash
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,39 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class MessageResponse
5
+ # Message of the response.
6
+ # @return [String]
7
+ attr_accessor :message
8
+
9
+ def initialize(message = nil)
10
+ @message = message
11
+
12
+ end
13
+
14
+ # Creates JSON of the curent object
15
+ def to_json(options = {})
16
+ hash = key_map
17
+ hash.to_json(options)
18
+ end
19
+
20
+ # Creates an instance of the object from a hash
21
+ def self.from_hash(hash)
22
+ if hash == nil
23
+ nil
24
+ else
25
+ # Extract variables from the hash
26
+ message = hash["message"]
27
+ # Create object from extracted values
28
+ MessageResponse.new(message)
29
+ end
30
+ end
31
+
32
+ # Defines the key map for json serialization
33
+ def key_map
34
+ hash = {}
35
+ hash['message'] = message
36
+ hash
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class Metadata
5
+ # TODO: Write general description for this method
6
+ # @return [String]
7
+ attr_accessor :id
8
+
9
+ def initialize(id = nil)
10
+ @id = id
11
+
12
+ end
13
+
14
+ # Creates JSON of the curent object
15
+ def to_json(options = {})
16
+ hash = key_map
17
+ hash.to_json(options)
18
+ end
19
+
20
+ # Creates an instance of the object from a hash
21
+ def self.from_hash(hash)
22
+ if hash == nil
23
+ nil
24
+ else
25
+ # Extract variables from the hash
26
+ id = hash["id"]
27
+ # Create object from extracted values
28
+ Metadata.new(id)
29
+ end
30
+ end
31
+
32
+ # Defines the key map for json serialization
33
+ def key_map
34
+ hash = {}
35
+ hash['id'] = id
36
+ hash
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,39 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class MetadataInformationResponse
5
+ # The number of users or items with metadata.
6
+ # @return [Long]
7
+ attr_accessor :count
8
+
9
+ def initialize(count = nil)
10
+ @count = count
11
+
12
+ end
13
+
14
+ # Creates JSON of the curent object
15
+ def to_json(options = {})
16
+ hash = key_map
17
+ hash.to_json(options)
18
+ end
19
+
20
+ # Creates an instance of the object from a hash
21
+ def self.from_hash(hash)
22
+ if hash == nil
23
+ nil
24
+ else
25
+ # Extract variables from the hash
26
+ count = hash["count"]
27
+ # Create object from extracted values
28
+ MetadataInformationResponse.new(count)
29
+ end
30
+ end
31
+
32
+ # Defines the key map for json serialization
33
+ def key_map
34
+ hash = {}
35
+ hash['count'] = count
36
+ hash
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,57 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class SchemaErrorResponse
5
+ # Message of the response.
6
+ # @return [String]
7
+ attr_accessor :message
8
+
9
+ # The cause of the error.
10
+ # @return [Object]
11
+ attr_accessor :value
12
+
13
+ # Programatic description of the error.
14
+ # @return [Object]
15
+ attr_accessor :error
16
+
17
+ def initialize(message = nil,
18
+ value = nil,
19
+ error = nil)
20
+ @message = message
21
+ @value = value
22
+ @error = error
23
+
24
+ end
25
+
26
+ # Creates JSON of the curent object
27
+ def to_json(options = {})
28
+ hash = key_map
29
+ hash.to_json(options)
30
+ end
31
+
32
+ # Creates an instance of the object from a hash
33
+ def self.from_hash(hash)
34
+ if hash == nil
35
+ nil
36
+ else
37
+ # Extract variables from the hash
38
+ message = hash["message"]
39
+ value = hash["value"]
40
+ error = hash["error"]
41
+ # Create object from extracted values
42
+ SchemaErrorResponse.new(message,
43
+ value,
44
+ error)
45
+ end
46
+ end
47
+
48
+ # Defines the key map for json serialization
49
+ def key_map
50
+ hash = {}
51
+ hash['message'] = message
52
+ hash['value'] = value
53
+ hash['error'] = error
54
+ hash
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,40 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class TypeRequestBody
5
+ # Could be "explicit" or "implicit"
6
+ # The default is "implicit".
7
+ # @return [String]
8
+ attr_accessor :rating
9
+
10
+ def initialize(rating = nil)
11
+ @rating = rating
12
+
13
+ end
14
+
15
+ # Creates JSON of the curent object
16
+ def to_json(options = {})
17
+ hash = key_map
18
+ hash.to_json(options)
19
+ end
20
+
21
+ # Creates an instance of the object from a hash
22
+ def self.from_hash(hash)
23
+ if hash == nil
24
+ nil
25
+ else
26
+ # Extract variables from the hash
27
+ rating = hash["rating"]
28
+ # Create object from extracted values
29
+ TypeRequestBody.new(rating)
30
+ end
31
+ end
32
+
33
+ # Defines the key map for json serialization
34
+ def key_map
35
+ hash = {}
36
+ hash['rating'] = rating
37
+ hash
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,53 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class UsersResponse
5
+ # The number of users in the response.
6
+ # @return [Long]
7
+ attr_accessor :count
8
+
9
+ # The number of users in the response.
10
+ # @return [List of Metadata]
11
+ attr_accessor :users
12
+
13
+ def initialize(count = nil,
14
+ users = nil)
15
+ @count = count
16
+ @users = users
17
+
18
+ end
19
+
20
+ # Creates JSON of the curent object
21
+ def to_json(options = {})
22
+ hash = key_map
23
+ hash.to_json(options)
24
+ end
25
+
26
+ # Creates an instance of the object from a hash
27
+ def self.from_hash(hash)
28
+ if hash == nil
29
+ nil
30
+ else
31
+ # Extract variables from the hash
32
+ count = hash["count"]
33
+ # Parameter is an array, so we need to iterate through it
34
+ users = nil
35
+ if hash["users"] != nil
36
+ users = Array.new
37
+ hash["users"].each{|structure| users << (Metadata.from_hash(structure) if structure)}
38
+ end
39
+ # Create object from extracted values
40
+ UsersResponse.new(count,
41
+ users)
42
+ end
43
+ end
44
+
45
+ # Defines the key map for json serialization
46
+ def key_map
47
+ hash = {}
48
+ hash['count'] = count
49
+ hash['users'] = users ? users.map(&:key_map) : nil
50
+ hash
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,47 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ require 'uri'
4
+
5
+ module SuggestGrid
6
+ class SuggestGridClient
7
+ # Singleton access to type controller
8
+ # @return [TypeController] Returns the controller instance
9
+ def type
10
+ TypeController.instance
11
+ end
12
+
13
+ # Singleton access to action controller
14
+ # @return [ActionController] Returns the controller instance
15
+ def action
16
+ ActionController.instance
17
+ end
18
+
19
+ # Singleton access to metadata controller
20
+ # @return [MetadataController] Returns the controller instance
21
+ def metadata
22
+ MetadataController.instance
23
+ end
24
+
25
+ # Singleton access to recommendation controller
26
+ # @return [RecommendationController] Returns the controller instance
27
+ def recommendation
28
+ RecommendationController.instance
29
+ end
30
+
31
+ # Singleton access to similarity controller
32
+ # @return [SimilarityController] Returns the controller instance
33
+ def similarity
34
+ SimilarityController.instance
35
+ end
36
+
37
+ # Initializer with authentication and configuration parameters
38
+ def initialize(connection_url)
39
+ uri = URI(connection_url)
40
+ Configuration.base_uri = "#{uri.scheme}://#{uri.host}:#{uri.port}#{uri.path}"
41
+ unless uri.user.nil?
42
+ Configuration.basic_auth_user_name = uri.user
43
+ Configuration.basic_auth_password = uri.password
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,48 @@
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+ require 'openssl'
3
+ require 'json'
4
+ require 'faraday'
5
+
6
+ # APIMATIC Helper Files
7
+ require_relative 'suggest_grid/api_helper.rb'
8
+ require_relative 'suggest_grid/configuration.rb'
9
+ require_relative 'suggest_grid/suggest_grid_client.rb'
10
+
11
+ # Http
12
+ require_relative 'suggest_grid/http/http_call_back.rb'
13
+ require_relative 'suggest_grid/http/http_client.rb'
14
+ require_relative 'suggest_grid/http/http_method_enum.rb'
15
+ require_relative 'suggest_grid/http/http_request.rb'
16
+ require_relative 'suggest_grid/http/http_response.rb'
17
+ require_relative 'suggest_grid/http/http_context.rb'
18
+ require_relative 'suggest_grid/http/unirest_client.rb'
19
+
20
+ # Models
21
+ require_relative 'suggest_grid/models/action.rb'
22
+ require_relative 'suggest_grid/models/metadata.rb'
23
+ require_relative 'suggest_grid/models/type_request_body.rb'
24
+ require_relative 'suggest_grid/models/get_recommended_users_body.rb'
25
+ require_relative 'suggest_grid/models/get_recommended_items_body.rb'
26
+ require_relative 'suggest_grid/models/get_similar_users_body.rb'
27
+ require_relative 'suggest_grid/models/get_similar_items_body.rb'
28
+ require_relative 'suggest_grid/models/message_response.rb'
29
+ require_relative 'suggest_grid/models/count_response.rb'
30
+ require_relative 'suggest_grid/models/error_response.rb'
31
+ require_relative 'suggest_grid/models/get_types_response.rb'
32
+ require_relative 'suggest_grid/models/get_type_response.rb'
33
+ require_relative 'suggest_grid/models/bulk_schema_error_response.rb'
34
+ require_relative 'suggest_grid/models/schema_error_response.rb'
35
+ require_relative 'suggest_grid/models/metadata_information_response.rb'
36
+ require_relative 'suggest_grid/models/users_response.rb'
37
+ require_relative 'suggest_grid/models/items_response.rb'
38
+
39
+ # Exceptions
40
+ require_relative 'suggest_grid/exceptions/api_exception.rb'
41
+
42
+ # Controllers
43
+ require_relative 'suggest_grid/controllers/base_controller.rb'
44
+ require_relative 'suggest_grid/controllers/type_controller.rb'
45
+ require_relative 'suggest_grid/controllers/action_controller.rb'
46
+ require_relative 'suggest_grid/controllers/metadata_controller.rb'
47
+ require_relative 'suggest_grid/controllers/recommendation_controller.rb'
48
+ require_relative 'suggest_grid/controllers/similarity_controller.rb'