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,49 +1,74 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class GetRecommendedUsersBody
5
- # TODO: Write general description for this method
4
+ class GetRecommendedUsersBody < BaseModel
5
+ # The type of the query.
6
6
  # @return [String]
7
7
  attr_accessor :type
8
8
 
9
- # TODO: Write general description for this method
9
+ # The types of the query. Exactly one of type or types parameters must be provided.
10
10
  # @return [String]
11
11
  attr_accessor :types
12
12
 
13
- # TODO: Write general description for this method
13
+ # The item id of the query.
14
14
  # @return [String]
15
15
  attr_accessor :item_id
16
16
 
17
- # TODO: Write general description for this method
17
+ # The item ids of the query. Exactly one of item id or item ids parameters must be provided.
18
18
  # @return [List of String]
19
19
  attr_accessor :item_ids
20
20
 
21
- # TODO: Write general description for this method
21
+ # The number of users asked to return in the response.
22
22
  # @return [Integer]
23
23
  attr_accessor :size
24
24
 
25
- # TODO: Write general description for this method
25
+ # Similar user that the response should be similar to.
26
26
  # @return [String]
27
27
  attr_accessor :similar_user_id
28
28
 
29
- # TODO: Write general description for this method
29
+ # Similar users that the response should be similar to.
30
+ # At most one of similar user and similar users parameters can be provided.
31
+ # @return [String]
32
+ attr_accessor :similar_user_ids
33
+
34
+ # The metadata fields that are to be included in returned users.
30
35
  # @return [List of String]
31
36
  attr_accessor :fields
32
37
 
33
- # TODO: Write general description for this method
38
+ # Contraints on the returned users or items.
39
+ # Filter structure is defined in [the filter parameter documentation](http://www.suggestgrid.com/docs/concepts#filters-parameter).
34
40
  # @return [Object]
35
41
  attr_accessor :filter
36
42
 
37
- # These ids will not be included in the response.
43
+ # These user ids that will not be included in the response.
38
44
  # @return [List of String]
39
45
  attr_accessor :except
40
46
 
47
+ # A mapping from model property names to API property names
48
+ def self.names
49
+ if @hash.nil?
50
+ @hash = {}
51
+ @hash["type"] = "type"
52
+ @hash["types"] = "types"
53
+ @hash["item_id"] = "item_id"
54
+ @hash["item_ids"] = "item_ids"
55
+ @hash["size"] = "size"
56
+ @hash["similar_user_id"] = "similar_user_id"
57
+ @hash["similar_user_ids"] = "similar_user_ids"
58
+ @hash["fields"] = "fields"
59
+ @hash["filter"] = "filter"
60
+ @hash["except"] = "except"
61
+ end
62
+ @hash
63
+ end
64
+
41
65
  def initialize(type = nil,
42
66
  types = nil,
43
67
  item_id = nil,
44
68
  item_ids = nil,
45
69
  size = nil,
46
70
  similar_user_id = nil,
71
+ similar_user_ids = nil,
47
72
  fields = nil,
48
73
  filter = nil,
49
74
  except = nil)
@@ -53,16 +78,10 @@ module SuggestGrid
53
78
  @item_ids = item_ids
54
79
  @size = size
55
80
  @similar_user_id = similar_user_id
81
+ @similar_user_ids = similar_user_ids
56
82
  @fields = fields
57
83
  @filter = filter
58
84
  @except = except
59
-
60
- end
61
-
62
- # Creates JSON of the curent object
63
- def to_json(options = {})
64
- hash = key_map
65
- hash.to_json(options)
66
85
  end
67
86
 
68
87
  # Creates an instance of the object from a hash
@@ -77,9 +96,11 @@ module SuggestGrid
77
96
  item_ids = hash["item_ids"]
78
97
  size = hash["size"]
79
98
  similar_user_id = hash["similar_user_id"]
99
+ similar_user_ids = hash["similar_user_ids"]
80
100
  fields = hash["fields"]
81
101
  filter = hash["filter"]
82
102
  except = hash["except"]
103
+
83
104
  # Create object from extracted values
84
105
  GetRecommendedUsersBody.new(type,
85
106
  types,
@@ -87,25 +108,11 @@ module SuggestGrid
87
108
  item_ids,
88
109
  size,
89
110
  similar_user_id,
111
+ similar_user_ids,
90
112
  fields,
91
113
  filter,
92
114
  except)
93
115
  end
94
116
  end
95
-
96
- # Defines the key map for json serialization
97
- def key_map
98
- hash = {}
99
- hash['type'] = type
100
- hash['types'] = types
101
- hash['item_id'] = item_id
102
- hash['item_ids'] = item_ids
103
- hash['size'] = size
104
- hash['similar_user_id'] = similar_user_id
105
- hash['fields'] = fields
106
- hash['filter'] = filter
107
- hash['except'] = except
108
- hash
109
- end
110
117
  end
111
118
  end
@@ -1,39 +1,56 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class GetSimilarItemsBody
5
- # TODO: Write general description for this method
4
+ class GetSimilarItemsBody < BaseModel
5
+ # The type of the query.
6
6
  # @return [String]
7
7
  attr_accessor :type
8
8
 
9
- # TODO: Write general description for this method
9
+ # The types of the query. Exactly one of type or types parameters must be provided.
10
10
  # @return [String]
11
11
  attr_accessor :types
12
12
 
13
- # Get similar items to given item id. Either item id or item ids must be provided.
13
+ # The item id of the query. Get similar items to given item id. Either item id or item ids must be provided.
14
14
  # @return [String]
15
15
  attr_accessor :item_id
16
16
 
17
- # Get similar items to given item ids. Either item id or item ids must be provided.
17
+ # The item ids of the query. Exactly one of item id or item ids parameters must be provided. Get similar items to given item ids. Either item id or item ids must be provided.
18
18
  # @return [List of String]
19
19
  attr_accessor :item_ids
20
20
 
21
- # Get similar items to given item ids. Either item id or item ids must be provided.
21
+ # The number of users asked to return in the response.
22
22
  # @return [Integer]
23
23
  attr_accessor :size
24
24
 
25
- # Get similar items to given item ids. Either item id or item ids must be provided.
25
+ # The metadata fields that are to be included in returned users.
26
26
  # @return [List of String]
27
27
  attr_accessor :fields
28
28
 
29
- # Get similar items to given item ids. Either item id or item ids must be provided.
29
+ # Contraints on the returned users or items.
30
+ # Filter structure is defined in [the filter parameter documentation](http://www.suggestgrid.com/docs/concepts#filters-parameter).
30
31
  # @return [Object]
31
32
  attr_accessor :filter
32
33
 
33
- # These ids will not be included in the response.
34
+ # These user ids that will not be included in the response.
34
35
  # @return [List of String]
35
36
  attr_accessor :except
36
37
 
38
+ # A mapping from model property names to API property names
39
+ def self.names
40
+ if @hash.nil?
41
+ @hash = {}
42
+ @hash["type"] = "type"
43
+ @hash["types"] = "types"
44
+ @hash["item_id"] = "item_id"
45
+ @hash["item_ids"] = "item_ids"
46
+ @hash["size"] = "size"
47
+ @hash["fields"] = "fields"
48
+ @hash["filter"] = "filter"
49
+ @hash["except"] = "except"
50
+ end
51
+ @hash
52
+ end
53
+
37
54
  def initialize(type = nil,
38
55
  types = nil,
39
56
  item_id = nil,
@@ -50,13 +67,6 @@ module SuggestGrid
50
67
  @fields = fields
51
68
  @filter = filter
52
69
  @except = except
53
-
54
- end
55
-
56
- # Creates JSON of the curent object
57
- def to_json(options = {})
58
- hash = key_map
59
- hash.to_json(options)
60
70
  end
61
71
 
62
72
  # Creates an instance of the object from a hash
@@ -73,6 +83,7 @@ module SuggestGrid
73
83
  fields = hash["fields"]
74
84
  filter = hash["filter"]
75
85
  except = hash["except"]
86
+
76
87
  # Create object from extracted values
77
88
  GetSimilarItemsBody.new(type,
78
89
  types,
@@ -84,19 +95,5 @@ module SuggestGrid
84
95
  except)
85
96
  end
86
97
  end
87
-
88
- # Defines the key map for json serialization
89
- def key_map
90
- hash = {}
91
- hash['type'] = type
92
- hash['types'] = types
93
- hash['item_id'] = item_id
94
- hash['item_ids'] = item_ids
95
- hash['size'] = size
96
- hash['fields'] = fields
97
- hash['filter'] = filter
98
- hash['except'] = except
99
- hash
100
- end
101
98
  end
102
99
  end
@@ -1,39 +1,56 @@
1
1
  # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
2
 
3
3
  module SuggestGrid
4
- class GetSimilarUsersBody
5
- # TODO: Write general description for this method
4
+ class GetSimilarUsersBody < BaseModel
5
+ # The type of the query.
6
6
  # @return [String]
7
7
  attr_accessor :type
8
8
 
9
- # TODO: Write general description for this method
9
+ # The types of the query. Exactly one of type or types parameters must be provided.
10
10
  # @return [String]
11
11
  attr_accessor :types
12
12
 
13
- # TODO: Write general description for this method
13
+ # The user id of the query.
14
14
  # @return [String]
15
15
  attr_accessor :user_id
16
16
 
17
- # TODO: Write general description for this method
17
+ # The user ids of the query. Exactly one of user id or user ids parameters must be provided.
18
18
  # @return [List of String]
19
19
  attr_accessor :user_ids
20
20
 
21
- # TODO: Write general description for this method
21
+ # The number of users asked to return in the response.
22
22
  # @return [Integer]
23
23
  attr_accessor :size
24
24
 
25
- # TODO: Write general description for this method
25
+ # The metadata fields that are to be included in returned users.
26
26
  # @return [List of String]
27
27
  attr_accessor :fields
28
28
 
29
- # TODO: Write general description for this method
29
+ # Contraints on the returned users or items.
30
+ # Filter structure is defined in [the filter parameter documentation](http://www.suggestgrid.com/docs/concepts#filters-parameter).
30
31
  # @return [Object]
31
32
  attr_accessor :filter
32
33
 
33
- # These ids will not be included in the response.
34
+ # These user ids that will not be included in the response.
34
35
  # @return [List of String]
35
36
  attr_accessor :except
36
37
 
38
+ # A mapping from model property names to API property names
39
+ def self.names
40
+ if @hash.nil?
41
+ @hash = {}
42
+ @hash["type"] = "type"
43
+ @hash["types"] = "types"
44
+ @hash["user_id"] = "user_id"
45
+ @hash["user_ids"] = "user_ids"
46
+ @hash["size"] = "size"
47
+ @hash["fields"] = "fields"
48
+ @hash["filter"] = "filter"
49
+ @hash["except"] = "except"
50
+ end
51
+ @hash
52
+ end
53
+
37
54
  def initialize(type = nil,
38
55
  types = nil,
39
56
  user_id = nil,
@@ -50,13 +67,6 @@ module SuggestGrid
50
67
  @fields = fields
51
68
  @filter = filter
52
69
  @except = except
53
-
54
- end
55
-
56
- # Creates JSON of the curent object
57
- def to_json(options = {})
58
- hash = key_map
59
- hash.to_json(options)
60
70
  end
61
71
 
62
72
  # Creates an instance of the object from a hash
@@ -73,6 +83,7 @@ module SuggestGrid
73
83
  fields = hash["fields"]
74
84
  filter = hash["filter"]
75
85
  except = hash["except"]
86
+
76
87
  # Create object from extracted values
77
88
  GetSimilarUsersBody.new(type,
78
89
  types,
@@ -84,19 +95,5 @@ module SuggestGrid
84
95
  except)
85
96
  end
86
97
  end
87
-
88
- # Defines the key map for json serialization
89
- def key_map
90
- hash = {}
91
- hash['type'] = type
92
- hash['types'] = types
93
- hash['user_id'] = user_id
94
- hash['user_ids'] = user_ids
95
- hash['size'] = size
96
- hash['fields'] = fields
97
- hash['filter'] = filter
98
- hash['except'] = except
99
- hash
100
- end
101
98
  end
102
99
  end
@@ -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 GetTypeResponse
5
- # Either 'implicit' or 'explicit'
4
+ class GetTypeResponse < BaseModel
5
+ # Rating type of the type that is either implicit or explicit.
6
6
  # @return [String]
7
7
  attr_accessor :rating
8
8
 
9
- def initialize(rating = nil)
10
- @rating = rating
11
-
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["rating"] = "rating"
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(rating = nil)
19
+ @rating = rating
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
  rating = hash["rating"]
29
+
27
30
  # Create object from extracted values
28
31
  GetTypeResponse.new(rating)
29
32
  end
30
33
  end
31
-
32
- # Defines the key map for json serialization
33
- def key_map
34
- hash = {}
35
- hash['rating'] = rating
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 GetTypesResponse
4
+ class GetTypesResponse < BaseModel
5
5
  # The list of type names
6
6
  # @return [List of String]
7
7
  attr_accessor :types
@@ -10,17 +10,20 @@ module SuggestGrid
10
10
  # @return [Integer]
11
11
  attr_accessor :status
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["types"] = "types"
18
+ @hash["status"] = "status"
19
+ end
20
+ @hash
21
+ end
22
+
13
23
  def initialize(types = nil,
14
24
  status = nil)
15
25
  @types = types
16
26
  @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
27
  end
25
28
 
26
29
  # Creates an instance of the object from a hash
@@ -31,18 +34,11 @@ module SuggestGrid
31
34
  # Extract variables from the hash
32
35
  types = hash["types"]
33
36
  status = hash["status"]
37
+
34
38
  # Create object from extracted values
35
39
  GetTypesResponse.new(types,
36
40
  status)
37
41
  end
38
42
  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
43
  end
48
44
  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 ItemsResponse
4
+ class ItemsResponse < BaseModel
5
5
  # The number of items 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 :items
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["items"] = "items"
19
+ end
20
+ @hash
21
+ end
22
+
13
23
  def initialize(count = nil,
14
24
  items = nil)
15
25
  @count = count
16
26
  @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
27
  end
25
28
 
26
29
  # Creates an instance of the object from a hash
@@ -36,18 +39,11 @@ module SuggestGrid
36
39
  items = Array.new
37
40
  hash["items"].each{|structure| items << (Metadata.from_hash(structure) if structure)}
38
41
  end
42
+
39
43
  # Create object from extracted values
40
44
  ItemsResponse.new(count,
41
45
  items)
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['items'] = items ? items.map(&:key_map) : nil
50
- hash
51
- end
52
48
  end
53
49
  end
@@ -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 MessageResponse
4
+ class MessageResponse < BaseModel
5
5
  # Message of the response.
6
6
  # @return [String]
7
7
  attr_accessor :message
8
8
 
9
- def initialize(message = nil)
10
- @message = message
11
-
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["message"] = "message"
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(message = nil)
19
+ @message = message
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
  message = hash["message"]
29
+
27
30
  # Create object from extracted values
28
31
  MessageResponse.new(message)
29
32
  end
30
33
  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
34
  end
39
35
  end
@@ -1,39 +1,34 @@
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
1
+ # This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module SuggestGrid
4
+ class Metadata < BaseModel
5
+ # The id of the user or the item that the metadata is associated with.
6
+ # Id parameter is necessary for all metadata.
7
+ # attr_accessor :id
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = self.instance_variables.inject({}) { |h, (k, v)| h[k] = k; h }
13
+ end
14
+ @hash
15
+ end
16
+
17
+ def initialize(props = {})
18
+ props.each do |name, value|
19
+ instance_variable_set("@#{name}", value)
20
+ singleton_class.class_eval { attr_accessor name }
21
+ end
22
+ end
23
+
24
+ # Creates an instance of the object from a hash
25
+ def self.from_hash(hash)
26
+ if hash == nil
27
+ nil
28
+ else
29
+ # Create object from extracted values
30
+ Metadata.new(hash)
31
+ end
32
+ end
33
+ end
34
+ end