suggestgrid 0.1.17.pre.SNAPSHOT → 0.1.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/suggest_grid/api_helper.rb +2 -2
  3. data/lib/suggest_grid/configuration.rb +2 -1
  4. data/lib/suggest_grid/controllers/action_controller.rb +77 -99
  5. data/lib/suggest_grid/controllers/base_controller.rb +27 -2
  6. data/lib/suggest_grid/controllers/metadata_controller.rb +259 -209
  7. data/lib/suggest_grid/controllers/recommendation_controller.rb +32 -44
  8. data/lib/suggest_grid/controllers/similarity_controller.rb +32 -44
  9. data/lib/suggest_grid/controllers/type_controller.rb +74 -104
  10. data/lib/suggest_grid/exceptions/api_exception.rb +1 -1
  11. data/lib/suggest_grid/exceptions/delete_error_response_exception.rb +52 -0
  12. data/lib/suggest_grid/exceptions/detailed_error_response_exception.rb +3 -3
  13. data/lib/suggest_grid/exceptions/error_response_exception.rb +3 -3
  14. data/lib/suggest_grid/exceptions/limit_exceeded_error_response_exception.rb +3 -3
  15. data/lib/suggest_grid/http/auth/basic_auth.rb +17 -0
  16. data/lib/suggest_grid/http/faraday_client.rb +43 -0
  17. data/lib/suggest_grid/http/http_call_back.rb +2 -2
  18. data/lib/suggest_grid/http/http_client.rb +13 -43
  19. data/lib/suggest_grid/http/http_request.rb +24 -8
  20. data/lib/suggest_grid/models/actions_response.rb +58 -0
  21. data/lib/suggest_grid/models/{schema_error_response.rb → bulk_post_error.rb} +4 -4
  22. data/lib/suggest_grid/models/bulk_post_response.rb +49 -0
  23. data/lib/suggest_grid/models/get_recommended_items_body.rb +14 -5
  24. data/lib/suggest_grid/models/get_recommended_users_body.rb +11 -2
  25. data/lib/suggest_grid/models/get_similar_items_body.rb +14 -5
  26. data/lib/suggest_grid/models/get_similar_users_body.rb +11 -2
  27. data/lib/suggest_grid/models/items_response.rb +10 -1
  28. data/lib/suggest_grid/models/users_response.rb +10 -1
  29. data/lib/suggest_grid.rb +53 -53
  30. data/spec/swagger.yaml +185 -87
  31. metadata +41 -15
  32. data/lib/suggest_grid/exceptions/bulk_schema_error_response_exception.rb +0 -37
  33. data/lib/suggest_grid/http/unirest_client.rb +0 -41
  34. data/lib/suggest_grid/models/count_response.rb +0 -35
  35. data/lib/suggest_grid/models/delete_error_response.rb +0 -80
  36. data/lib/suggest_grid/models/metadata_information_response.rb +0 -35
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.17.pre.SNAPSHOT
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - SuggestGrid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -30,28 +30,54 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.11
33
+ version: 0.10.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.11
40
+ version: 0.10.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: json_mapper
42
+ name: certifi
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.1
47
+ version: '2016.9'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2016.09.26
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: 0.2.1
57
+ version: '2016.9'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 2016.09.26
61
+ - !ruby/object:Gem::Dependency
62
+ name: faraday-http-cache
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.2'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 1.2.2
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '1.2'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 1.2.2
55
81
  description: SuggestGrid is a recommendation and personalization service.
56
82
  email: support@suggestgrid.com
57
83
  executables: []
@@ -70,21 +96,23 @@ files:
70
96
  - lib/suggest_grid/controllers/similarity_controller.rb
71
97
  - lib/suggest_grid/controllers/type_controller.rb
72
98
  - lib/suggest_grid/exceptions/api_exception.rb
73
- - lib/suggest_grid/exceptions/bulk_schema_error_response_exception.rb
99
+ - lib/suggest_grid/exceptions/delete_error_response_exception.rb
74
100
  - lib/suggest_grid/exceptions/detailed_error_response_exception.rb
75
101
  - lib/suggest_grid/exceptions/error_response_exception.rb
76
102
  - lib/suggest_grid/exceptions/limit_exceeded_error_response_exception.rb
103
+ - lib/suggest_grid/http/auth/basic_auth.rb
104
+ - lib/suggest_grid/http/faraday_client.rb
77
105
  - lib/suggest_grid/http/http_call_back.rb
78
106
  - lib/suggest_grid/http/http_client.rb
79
107
  - lib/suggest_grid/http/http_context.rb
80
108
  - lib/suggest_grid/http/http_method_enum.rb
81
109
  - lib/suggest_grid/http/http_request.rb
82
110
  - lib/suggest_grid/http/http_response.rb
83
- - lib/suggest_grid/http/unirest_client.rb
84
111
  - lib/suggest_grid/models/action.rb
112
+ - lib/suggest_grid/models/actions_response.rb
85
113
  - lib/suggest_grid/models/base_model.rb
86
- - lib/suggest_grid/models/count_response.rb
87
- - lib/suggest_grid/models/delete_error_response.rb
114
+ - lib/suggest_grid/models/bulk_post_error.rb
115
+ - lib/suggest_grid/models/bulk_post_response.rb
88
116
  - lib/suggest_grid/models/delete_success_response.rb
89
117
  - lib/suggest_grid/models/get_recommended_items_body.rb
90
118
  - lib/suggest_grid/models/get_recommended_users_body.rb
@@ -95,8 +123,6 @@ files:
95
123
  - lib/suggest_grid/models/items_response.rb
96
124
  - lib/suggest_grid/models/message_response.rb
97
125
  - lib/suggest_grid/models/metadata.rb
98
- - lib/suggest_grid/models/metadata_information_response.rb
99
- - lib/suggest_grid/models/schema_error_response.rb
100
126
  - lib/suggest_grid/models/type_request_body.rb
101
127
  - lib/suggest_grid/models/users_response.rb
102
128
  - lib/suggest_grid/suggest_grid_client.rb
@@ -116,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
142
  version: '2.0'
117
143
  required_rubygems_version: !ruby/object:Gem::Requirement
118
144
  requirements:
119
- - - ">"
145
+ - - ">="
120
146
  - !ruby/object:Gem::Version
121
- version: 1.3.1
147
+ version: '0'
122
148
  requirements: []
123
149
  rubyforge_project:
124
150
  rubygems_version: 2.4.5.1
@@ -1,37 +0,0 @@
1
- # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module SuggestGrid
4
- class BulkSchemaErrorResponseException < APIException
5
- # Message of the response.
6
- # @return [String]
7
- attr_accessor :message
8
-
9
- # Message of the response.
10
- # @return [List of SchemaErrorResponse]
11
- attr_accessor :errors
12
-
13
- # The constructor.
14
- # @param [String] The reason for raising an exception
15
- # @param [HttpContext] The HttpContext of the API call.
16
- def initialize(reason, context)
17
- super(reason, context)
18
- begin
19
- hash = APIHelper.json_deserialize(@context.response.raw_body)
20
- unbox(hash)
21
- rescue TypeError
22
- end
23
- end
24
-
25
- # Populates this object by extracting properties from a hash.
26
- # @param [Hash] The deserialized response sent by the server in the response body.
27
- def unbox(hash)
28
- @message = hash["message"]
29
- # Parameter is an array, so we need to iterate through it
30
- @errors = nil
31
- if hash["errors"] != nil
32
- @errors = Array.new
33
- hash["errors"].each{|structure| @errors << (SchemaErrorResponse.from_hash(structure) if structure)}
34
- end
35
- end
36
- end
37
- end
@@ -1,41 +0,0 @@
1
- # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
- module SuggestGrid
3
- class UnirestClient < HttpClient
4
- # Method overridden from HttpClient.
5
- def execute_as_string(http_request)
6
-
7
- response = get_connection(http_request.username, http_request.password)
8
- .send(http_request.http_method.downcase, http_request.query_url) do |faraday_request|
9
- faraday_request.headers = http_request.headers
10
- faraday_request.body = http_request.parameters
11
- end
12
-
13
- return convert_response(response)
14
- end
15
-
16
- # Method overridden from HttpClient.
17
- def execute_as_binary(http_request)
18
-
19
- response = get_connection(http_request.username, http_request.password)
20
- .send(http_request.http_method.downcase, http_request.query_url) do |faraday_request|
21
- faraday_request.headers = http_request.headers
22
- faraday_request.body = http_request.parameters
23
- end
24
-
25
- return convert_response(response)
26
- end
27
-
28
- # Method overridden from HttpClient.
29
- def convert_response(response)
30
- return HttpResponse.new(response.status, response.headers, response.body)
31
- end
32
-
33
- def get_connection(user_name, password)
34
- Faraday.new do |builder|
35
- builder.request :retry
36
- builder.request :basic_auth, user_name, password if user_name
37
- builder.adapter :net_http
38
- end
39
- end
40
- end
41
- end
@@ -1,35 +0,0 @@
1
- # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module SuggestGrid
4
- class CountResponse < BaseModel
5
- # The count that is asked in the query.
6
- # @return [Integer]
7
- attr_accessor :count
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["count"] = "count"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(count = nil)
19
- @count = count
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- count = hash["count"]
29
-
30
- # Create object from extracted values
31
- CountResponse.new(count)
32
- end
33
- end
34
- end
35
- end
@@ -1,80 +0,0 @@
1
- # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module SuggestGrid
4
- class DeleteErrorResponse < BaseModel
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
- # URI of the response for more details.
14
- # @return [String]
15
- attr_accessor :error_uri
16
-
17
- # The number of records found for the delete query.
18
- # @return [Integer]
19
- attr_accessor :found
20
-
21
- # The number of records deleted for the delete query.
22
- # @return [Integer]
23
- attr_accessor :deleted
24
-
25
- # The number of records found but not deleted for the delete query.
26
- # @return [Integer]
27
- attr_accessor :failed
28
-
29
- # A mapping from model property names to API property names
30
- def self.names
31
- if @hash.nil?
32
- @hash = {}
33
- @hash["error_text"] = "error_text"
34
- @hash["error_description"] = "error_description"
35
- @hash["error_uri"] = "error_uri"
36
- @hash["found"] = "found"
37
- @hash["deleted"] = "deleted"
38
- @hash["failed"] = "failed"
39
- end
40
- @hash
41
- end
42
-
43
- def initialize(error_text = nil,
44
- error_description = nil,
45
- error_uri = nil,
46
- found = nil,
47
- deleted = nil,
48
- failed = nil)
49
- @error_text = error_text
50
- @error_description = error_description
51
- @error_uri = error_uri
52
- @found = found
53
- @deleted = deleted
54
- @failed = failed
55
- end
56
-
57
- # Creates an instance of the object from a hash
58
- def self.from_hash(hash)
59
- if hash == nil
60
- nil
61
- else
62
- # Extract variables from the hash
63
- error_text = hash["error_text"]
64
- error_description = hash["error_description"]
65
- error_uri = hash["error_uri"]
66
- found = hash["found"]
67
- deleted = hash["deleted"]
68
- failed = hash["failed"]
69
-
70
- # Create object from extracted values
71
- DeleteErrorResponse.new(error_text,
72
- error_description,
73
- error_uri,
74
- found,
75
- deleted,
76
- failed)
77
- end
78
- end
79
- end
80
- end
@@ -1,35 +0,0 @@
1
- # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module SuggestGrid
4
- class MetadataInformationResponse < BaseModel
5
- # The number of users or items with metadata.
6
- # @return [Long]
7
- attr_accessor :count
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["count"] = "count"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(count = nil)
19
- @count = count
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- count = hash["count"]
29
-
30
- # Create object from extracted values
31
- MetadataInformationResponse.new(count)
32
- end
33
- end
34
- end
35
- end