suggestgrid 0.1.15.pre.SNAPSHOT → 0.1.17.pre.SNAPSHOT

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/README.md +1 -1
  3. data/lib/suggest_grid/api_helper.rb +2 -2
  4. data/lib/suggest_grid/configuration.rb +1 -1
  5. data/lib/suggest_grid/controllers/action_controller.rb +24 -18
  6. data/lib/suggest_grid/controllers/metadata_controller.rb +36 -32
  7. data/lib/suggest_grid/controllers/recommendation_controller.rb +12 -12
  8. data/lib/suggest_grid/controllers/similarity_controller.rb +12 -12
  9. data/lib/suggest_grid/controllers/type_controller.rb +12 -12
  10. data/lib/suggest_grid/exceptions/bulk_schema_error_response_exception.rb +37 -0
  11. data/lib/suggest_grid/exceptions/detailed_error_response_exception.rb +42 -0
  12. data/lib/suggest_grid/exceptions/error_response_exception.rb +37 -0
  13. data/lib/suggest_grid/exceptions/limit_exceeded_error_response_exception.rb +47 -0
  14. data/lib/suggest_grid/models/action.rb +15 -19
  15. data/lib/suggest_grid/models/base_model.rb +32 -0
  16. data/lib/suggest_grid/models/count_response.rb +12 -16
  17. data/lib/suggest_grid/models/delete_error_response.rb +80 -0
  18. data/lib/suggest_grid/models/delete_success_response.rb +62 -0
  19. data/lib/suggest_grid/models/get_recommended_items_body.rb +39 -32
  20. data/lib/suggest_grid/models/get_recommended_users_body.rb +39 -32
  21. data/lib/suggest_grid/models/get_similar_items_body.rb +27 -30
  22. data/lib/suggest_grid/models/get_similar_users_body.rb +27 -30
  23. data/lib/suggest_grid/models/get_type_response.rb +12 -16
  24. data/lib/suggest_grid/models/get_types_response.rb +12 -16
  25. data/lib/suggest_grid/models/items_response.rb +12 -16
  26. data/lib/suggest_grid/models/message_response.rb +11 -15
  27. data/lib/suggest_grid/models/metadata.rb +34 -39
  28. data/lib/suggest_grid/models/metadata_information_response.rb +11 -15
  29. data/lib/suggest_grid/models/schema_error_response.rb +13 -17
  30. data/lib/suggest_grid/models/type_request_body.rb +12 -15
  31. data/lib/suggest_grid/models/users_response.rb +12 -16
  32. data/lib/suggest_grid.rb +7 -2
  33. data/spec/swagger.yaml +235 -121
  34. metadata +10 -5
  35. data/lib/suggest_grid/models/bulk_schema_error_response.rb +0 -53
  36. data/lib/suggest_grid/models/error_response.rb +0 -48
@@ -1,20 +1,22 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class MetadataInformationResponse
4
+ class MetadataInformationResponse < BaseModel
5
5
  # The number of users or items with metadata.
6
6
  # @return [Long]
7
7
  attr_accessor :count
8
8
 
9
- def initialize(count = nil)
10
- @count = count
11
-
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
12
16
  end
13
17
 
14
- # Creates JSON of the curent object
15
- def to_json(options = {})
16
- hash = key_map
17
- hash.to_json(options)
18
+ def initialize(count = nil)
19
+ @count = count
18
20
  end
19
21
 
20
22
  # Creates an instance of the object from a hash
@@ -24,16 +26,10 @@ module SuggestGrid
24
26
  else
25
27
  # Extract variables from the hash
26
28
  count = hash["count"]
29
+
27
30
  # Create object from extracted values
28
31
  MetadataInformationResponse.new(count)
29
32
  end
30
33
  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
34
  end
39
35
  end
@@ -1,7 +1,7 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class SchemaErrorResponse
4
+ class SchemaErrorResponse < BaseModel
5
5
  # Message of the response.
6
6
  # @return [String]
7
7
  attr_accessor :message
@@ -14,19 +14,23 @@ module SuggestGrid
14
14
  # @return [Object]
15
15
  attr_accessor :error
16
16
 
17
+ # A mapping from model property names to API property names
18
+ def self.names
19
+ if @hash.nil?
20
+ @hash = {}
21
+ @hash["message"] = "message"
22
+ @hash["value"] = "value"
23
+ @hash["error"] = "error"
24
+ end
25
+ @hash
26
+ end
27
+
17
28
  def initialize(message = nil,
18
29
  value = nil,
19
30
  error = nil)
20
31
  @message = message
21
32
  @value = value
22
33
  @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
34
  end
31
35
 
32
36
  # Creates an instance of the object from a hash
@@ -38,20 +42,12 @@ module SuggestGrid
38
42
  message = hash["message"]
39
43
  value = hash["value"]
40
44
  error = hash["error"]
45
+
41
46
  # Create object from extracted values
42
47
  SchemaErrorResponse.new(message,
43
48
  value,
44
49
  error)
45
50
  end
46
51
  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
52
  end
57
53
  end
@@ -1,21 +1,24 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class TypeRequestBody
4
+ class TypeRequestBody < BaseModel
5
+ # The rating type of the type to be created.
5
6
  # Could be "explicit" or "implicit"
6
7
  # The default is "implicit".
7
8
  # @return [String]
8
9
  attr_accessor :rating
9
10
 
10
- def initialize(rating = nil)
11
- @rating = rating
12
-
11
+ # A mapping from model property names to API property names
12
+ def self.names
13
+ if @hash.nil?
14
+ @hash = {}
15
+ @hash["rating"] = "rating"
16
+ end
17
+ @hash
13
18
  end
14
19
 
15
- # Creates JSON of the curent object
16
- def to_json(options = {})
17
- hash = key_map
18
- hash.to_json(options)
20
+ def initialize(rating = nil)
21
+ @rating = rating
19
22
  end
20
23
 
21
24
  # Creates an instance of the object from a hash
@@ -25,16 +28,10 @@ module SuggestGrid
25
28
  else
26
29
  # Extract variables from the hash
27
30
  rating = hash["rating"]
31
+
28
32
  # Create object from extracted values
29
33
  TypeRequestBody.new(rating)
30
34
  end
31
35
  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
36
  end
40
37
  end
@@ -1,7 +1,7 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class UsersResponse
4
+ class UsersResponse < BaseModel
5
5
  # The number of users in the response.
6
6
  # @return [Long]
7
7
  attr_accessor :count
@@ -10,17 +10,20 @@ module SuggestGrid
10
10
  # @return [List of Metadata]
11
11
  attr_accessor :users
12
12
 
13
+ # A mapping from model property names to API property names
14
+ def self.names
15
+ if @hash.nil?
16
+ @hash = {}
17
+ @hash["count"] = "count"
18
+ @hash["users"] = "users"
19
+ end
20
+ @hash
21
+ end
22
+
13
23
  def initialize(count = nil,
14
24
  users = nil)
15
25
  @count = count
16
26
  @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
27
  end
25
28
 
26
29
  # Creates an instance of the object from a hash
@@ -36,18 +39,11 @@ module SuggestGrid
36
39
  users = Array.new
37
40
  hash["users"].each{|structure| users << (Metadata.from_hash(structure) if structure)}
38
41
  end
42
+
39
43
  # Create object from extracted values
40
44
  UsersResponse.new(count,
41
45
  users)
42
46
  end
43
47
  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
48
  end
53
49
  end
data/lib/suggest_grid.rb CHANGED
@@ -18,6 +18,7 @@ require_relative 'suggest_grid/http/http_context.rb'
18
18
  require_relative 'suggest_grid/http/unirest_client.rb'
19
19
 
20
20
  # Models
21
+ require_relative 'suggest_grid/models/base_model.rb'
21
22
  require_relative 'suggest_grid/models/action.rb'
22
23
  require_relative 'suggest_grid/models/metadata.rb'
23
24
  require_relative 'suggest_grid/models/type_request_body.rb'
@@ -27,10 +28,10 @@ require_relative 'suggest_grid/models/get_similar_users_body.rb'
27
28
  require_relative 'suggest_grid/models/get_similar_items_body.rb'
28
29
  require_relative 'suggest_grid/models/message_response.rb'
29
30
  require_relative 'suggest_grid/models/count_response.rb'
30
- require_relative 'suggest_grid/models/error_response.rb'
31
+ require_relative 'suggest_grid/models/delete_error_response.rb'
32
+ require_relative 'suggest_grid/models/delete_success_response.rb'
31
33
  require_relative 'suggest_grid/models/get_types_response.rb'
32
34
  require_relative 'suggest_grid/models/get_type_response.rb'
33
- require_relative 'suggest_grid/models/bulk_schema_error_response.rb'
34
35
  require_relative 'suggest_grid/models/schema_error_response.rb'
35
36
  require_relative 'suggest_grid/models/metadata_information_response.rb'
36
37
  require_relative 'suggest_grid/models/users_response.rb'
@@ -38,6 +39,10 @@ require_relative 'suggest_grid/models/items_response.rb'
38
39
 
39
40
  # Exceptions
40
41
  require_relative 'suggest_grid/exceptions/api_exception.rb'
42
+ require_relative 'suggest_grid/exceptions/error_response_exception.rb'
43
+ require_relative 'suggest_grid/exceptions/detailed_error_response_exception.rb'
44
+ require_relative 'suggest_grid/exceptions/limit_exceeded_error_response_exception.rb'
45
+ require_relative 'suggest_grid/exceptions/bulk_schema_error_response_exception.rb'
41
46
 
42
47
  # Controllers
43
48
  require_relative 'suggest_grid/controllers/base_controller.rb'