suggestgrid 0.1.32.rc2 → 0.2.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/{suggest_grid → suggestgrid}/api_helper.rb +80 -56
- data/lib/{suggest_grid → suggestgrid}/configuration.rb +1 -2
- data/lib/{suggest_grid → suggestgrid}/controllers/action_controller.rb +17 -17
- data/lib/{suggest_grid → suggestgrid}/controllers/base_controller.rb +5 -5
- data/lib/{suggest_grid → suggestgrid}/controllers/metadata_controller.rb +22 -22
- data/lib/{suggest_grid → suggestgrid}/controllers/recommendation_controller.rb +8 -8
- data/lib/{suggest_grid → suggestgrid}/controllers/similarity_controller.rb +8 -8
- data/lib/{suggest_grid → suggestgrid}/controllers/type_controller.rb +10 -10
- data/lib/{suggest_grid/exceptions/delete_error_response_exception.rb → suggestgrid/exceptions/delete_error_response_error_exception.rb} +9 -9
- data/lib/{suggest_grid/exceptions/detailed_error_response_exception.rb → suggestgrid/exceptions/detailed_error_response_error_exception.rb} +7 -7
- data/lib/{suggest_grid/exceptions/error_response_exception.rb → suggestgrid/exceptions/error_response_error_exception.rb} +6 -6
- data/lib/{suggest_grid/exceptions/limit_exceeded_error_response_exception.rb → suggestgrid/exceptions/limit_exceeded_error_response_error_exception.rb} +8 -8
- data/lib/{suggest_grid → suggestgrid}/http/faraday_client.rb +5 -7
- data/lib/{suggest_grid → suggestgrid}/http/http_call_back.rb +4 -4
- data/lib/{suggest_grid → suggestgrid}/http/http_client.rb +3 -3
- data/lib/{suggest_grid → suggestgrid}/http/http_context.rb +1 -1
- data/lib/{suggest_grid → suggestgrid}/http/http_method_enum.rb +1 -1
- data/lib/{suggest_grid → suggestgrid}/http/http_request.rb +4 -4
- data/lib/{suggest_grid → suggestgrid}/http/http_response.rb +2 -2
- data/lib/{suggest_grid → suggestgrid}/models/action.rb +22 -32
- data/lib/suggestgrid/models/actions_response.rb +56 -0
- data/lib/{suggest_grid → suggestgrid}/models/base_model.rb +0 -17
- data/lib/suggestgrid/models/bulk_post_error.rb +51 -0
- data/lib/suggestgrid/models/bulk_post_response.rb +47 -0
- data/lib/suggestgrid/models/delete_success_response.rb +60 -0
- data/lib/{suggest_grid → suggestgrid}/models/get_recommended_items_body.rb +42 -52
- data/lib/{suggest_grid → suggestgrid}/models/get_recommended_users_body.rb +42 -52
- data/lib/{suggest_grid → suggestgrid}/models/get_similar_items_body.rb +34 -44
- data/lib/{suggest_grid → suggestgrid}/models/get_similar_users_body.rb +34 -44
- data/lib/suggestgrid/models/get_type_response.rb +33 -0
- data/lib/suggestgrid/models/get_types_response.rb +33 -0
- data/lib/suggestgrid/models/items_response.rb +56 -0
- data/lib/suggestgrid/models/message_response.rb +33 -0
- data/lib/suggestgrid/models/metadata.rb +49 -0
- data/lib/suggestgrid/models/type_request_body.rb +33 -0
- data/lib/suggestgrid/models/users_response.rb +56 -0
- data/lib/suggestgrid.rb +55 -0
- data/spec/swagger.yaml +3 -8
- metadata +45 -45
- data/lib/suggest_grid/models/actions_response.rb +0 -66
- data/lib/suggest_grid/models/bulk_post_error.rb +0 -61
- data/lib/suggest_grid/models/bulk_post_response.rb +0 -57
- data/lib/suggest_grid/models/delete_success_response.rb +0 -70
- data/lib/suggest_grid/models/get_type_response.rb +0 -43
- data/lib/suggest_grid/models/get_types_response.rb +0 -43
- data/lib/suggest_grid/models/items_response.rb +0 -66
- data/lib/suggest_grid/models/message_response.rb +0 -43
- data/lib/suggest_grid/models/metadata.rb +0 -43
- data/lib/suggest_grid/models/type_request_body.rb +0 -43
- data/lib/suggest_grid/models/users_response.rb +0 -66
- data/lib/suggest_grid.rb +0 -55
- /data/lib/{suggest_grid → suggestgrid}/exceptions/api_exception.rb +0 -0
- /data/lib/{suggest_grid → suggestgrid}/http/auth/basic_auth.rb +0 -0
- /data/lib/{suggest_grid/suggest_grid_client.rb → suggestgrid/suggestgrid_client.rb} +0 -0
@@ -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
|
4
|
+
class DeleteErrorResponseErrorException < APIException
|
5
5
|
# Message of the response.
|
6
6
|
# @return [String]
|
7
7
|
attr_accessor :error_text
|
@@ -37,16 +37,16 @@ module SuggestGrid
|
|
37
37
|
rescue TypeError
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
# Populates this object by extracting properties from a hash.
|
42
42
|
# @param [Hash] The deserialized response sent by the server in the response body.
|
43
43
|
def unbox(hash)
|
44
|
-
@error_text = hash[
|
45
|
-
@error_description = hash[
|
46
|
-
@error_uri = hash[
|
47
|
-
@found = hash[
|
48
|
-
@deleted = hash[
|
49
|
-
@failed = hash[
|
44
|
+
@error_text = hash['error_text']
|
45
|
+
@error_description = hash['error_description']
|
46
|
+
@error_uri = hash['error_uri']
|
47
|
+
@found = hash['found']
|
48
|
+
@deleted = hash['deleted']
|
49
|
+
@failed = hash['failed']
|
50
50
|
end
|
51
51
|
end
|
52
|
-
end
|
52
|
+
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
|
4
|
+
class DetailedErrorResponseErrorException < APIException
|
5
5
|
# Message of the response.
|
6
6
|
# @return [String]
|
7
7
|
attr_accessor :error_text
|
@@ -29,14 +29,14 @@ module SuggestGrid
|
|
29
29
|
rescue TypeError
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
# Populates this object by extracting properties from a hash.
|
34
34
|
# @param [Hash] The deserialized response sent by the server in the response body.
|
35
35
|
def unbox(hash)
|
36
|
-
@error_text = hash[
|
37
|
-
@error_description = hash[
|
38
|
-
@error_uri = hash[
|
39
|
-
@error_details = hash[
|
36
|
+
@error_text = hash['error_text']
|
37
|
+
@error_description = hash['error_description']
|
38
|
+
@error_uri = hash['error_uri']
|
39
|
+
@error_details = hash['error_details']
|
40
40
|
end
|
41
41
|
end
|
42
|
-
end
|
42
|
+
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
|
4
|
+
class ErrorResponseErrorException < APIException
|
5
5
|
# Message of the response.
|
6
6
|
# @return [String]
|
7
7
|
attr_accessor :error_text
|
@@ -25,13 +25,13 @@ module SuggestGrid
|
|
25
25
|
rescue TypeError
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
# Populates this object by extracting properties from a hash.
|
30
30
|
# @param [Hash] The deserialized response sent by the server in the response body.
|
31
31
|
def unbox(hash)
|
32
|
-
@error_text = hash[
|
33
|
-
@error_description = hash[
|
34
|
-
@error_uri = hash[
|
32
|
+
@error_text = hash['error_text']
|
33
|
+
@error_description = hash['error_description']
|
34
|
+
@error_uri = hash['error_uri']
|
35
35
|
end
|
36
36
|
end
|
37
|
-
end
|
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
|
4
|
+
class LimitExceededErrorResponseErrorException < APIException
|
5
5
|
# Message of the response.
|
6
6
|
# @return [String]
|
7
7
|
attr_accessor :error_text
|
@@ -33,15 +33,15 @@ module SuggestGrid
|
|
33
33
|
rescue TypeError
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
# Populates this object by extracting properties from a hash.
|
38
38
|
# @param [Hash] The deserialized response sent by the server in the response body.
|
39
39
|
def unbox(hash)
|
40
|
-
@error_text = hash[
|
41
|
-
@error_description = hash[
|
42
|
-
@error_uri = hash[
|
43
|
-
@used = hash[
|
44
|
-
@limit = hash[
|
40
|
+
@error_text = hash['error_text']
|
41
|
+
@error_description = hash['error_description']
|
42
|
+
@error_uri = hash['error_uri']
|
43
|
+
@used = hash['used']
|
44
|
+
@limit = hash['limit']
|
45
45
|
end
|
46
46
|
end
|
47
|
-
end
|
47
|
+
end
|
@@ -13,33 +13,31 @@ module SuggestGrid
|
|
13
13
|
faraday.adapter Faraday.default_adapter
|
14
14
|
faraday.options[:params_encoder] = Faraday::FlatParamsEncoder
|
15
15
|
faraday.options[:open_timeout] = timeout if timeout
|
16
|
-
faraday.request :retry, max: max_retries, interval: retry_interval if (max_retries
|
16
|
+
faraday.request :retry, max: max_retries, interval: retry_interval if (max_retries && retry_interval)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
# Method overridden from HttpClient.
|
21
21
|
def execute_as_string(http_request)
|
22
|
-
response = @connection.send(http_request.http_method.downcase, http_request.query_url) do |request|
|
22
|
+
response = @connection.send(http_request.http_method.downcase, http_request.query_url) do |request|
|
23
23
|
request.headers = http_request.headers
|
24
24
|
request.body = http_request.parameters
|
25
25
|
end
|
26
|
-
|
27
26
|
return convert_response(response)
|
28
27
|
end
|
29
28
|
|
30
29
|
# Method overridden from HttpClient.
|
31
30
|
def execute_as_binary(http_request)
|
32
|
-
response = @connection.send(http_request.http_method.downcase, http_request.query_url) do |request|
|
31
|
+
response = @connection.send(http_request.http_method.downcase, http_request.query_url) do |request|
|
33
32
|
request.headers = http_request.headers
|
34
33
|
request.body = http_request.parameters
|
35
34
|
end
|
36
|
-
|
37
35
|
return convert_response(response)
|
38
36
|
end
|
39
37
|
|
40
38
|
# Method overridden from HttpClient.
|
41
39
|
def convert_response(response)
|
42
|
-
|
40
|
+
HttpResponse.new(response.status, response.headers, response.body)
|
43
41
|
end
|
44
42
|
end
|
45
|
-
end
|
43
|
+
end
|
@@ -5,13 +5,13 @@ module SuggestGrid
|
|
5
5
|
# A controller will call this method before making an HTTP Request.
|
6
6
|
# @param [HttpRequest] The HttpRequest object which the HttpClient will execute.
|
7
7
|
def on_before_request(http_request)
|
8
|
-
raise NotImplementedError,
|
8
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
# A controller will call this method after making an HTTP Request.
|
12
12
|
# @param [HttpContext] The HttpContext of the API call.
|
13
13
|
def on_after_response(http_context)
|
14
|
-
raise NotImplementedError,
|
14
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
15
15
|
end
|
16
16
|
end
|
17
|
-
end
|
17
|
+
end
|
@@ -5,19 +5,19 @@ module SuggestGrid
|
|
5
5
|
# Execute an HttpRequest when the response is expected to be a string.
|
6
6
|
# @param [HttpRequest] The HttpRequest to be executed.
|
7
7
|
def execute_as_string(http_request)
|
8
|
-
raise NotImplementedError,
|
8
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
9
9
|
end
|
10
10
|
|
11
11
|
# Execute an HttpRequest when the response is expected to be binary.
|
12
12
|
# @param [HttpRequest] The HttpRequest to be executed.
|
13
13
|
def execute_as_binary(http_request)
|
14
|
-
raise NotImplementedError,
|
14
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
15
15
|
end
|
16
16
|
|
17
17
|
# Converts the HTTP Response from the client to an HttpResponse object.
|
18
18
|
# @param [Dynamic] The response object received from the client.
|
19
19
|
def convert_response(response)
|
20
|
-
raise NotImplementedError,
|
20
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
21
21
|
end
|
22
22
|
|
23
23
|
# Get a GET HttpRequest object.
|
@@ -4,7 +4,7 @@ module SuggestGrid
|
|
4
4
|
class HttpRequest
|
5
5
|
attr_accessor :http_method, :query_url, :headers, :parameters, :username, :password
|
6
6
|
|
7
|
-
# The constructor.
|
7
|
+
# The constructor.
|
8
8
|
# @param [HttpMethodEnum] The HTTP method.
|
9
9
|
# @param [String] The URL to send the request to.
|
10
10
|
# @param [Hash, Optional] The headers for the HTTP Request.
|
@@ -25,19 +25,19 @@ module SuggestGrid
|
|
25
25
|
def add_header(name, value)
|
26
26
|
@headers[name] = value
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
# Add a parameter to the HttpRequest.
|
30
30
|
# @param [String] The name of the parameter.
|
31
31
|
# @param [String] The value of the parameter.
|
32
32
|
def add_parameter(name, value)
|
33
33
|
@parameters[name] = value
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
# Add a query parameter to the HttpRequest.
|
37
37
|
# @param [String] The name of the query parameter.
|
38
38
|
# @param [String] The value of the query parameter.
|
39
39
|
def add_query_parameter(name, value)
|
40
|
-
@query_url = APIHelper.append_url_with_query_parameters(@query_url,
|
40
|
+
@query_url = APIHelper.append_url_with_query_parameters(@query_url, name => value)
|
41
41
|
@query_url = APIHelper.clean_url(@query_url)
|
42
42
|
end
|
43
43
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
module SuggestGrid
|
4
4
|
class HttpResponse
|
5
5
|
attr_accessor :status_code, :headers, :raw_body
|
6
|
-
|
7
|
-
# The constructor
|
6
|
+
|
7
|
+
# The constructor
|
8
8
|
# @param [Integer] The status code returned by the server.
|
9
9
|
# @param [Hash] The headers sent by the server in the response.
|
10
10
|
# @param [String] The raw body of the response.
|
@@ -24,56 +24,46 @@ module SuggestGrid
|
|
24
24
|
|
25
25
|
# A mapping from model property names to API property names
|
26
26
|
def self.names
|
27
|
-
if @
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
27
|
+
if @_hash.nil?
|
28
|
+
@_hash = {}
|
29
|
+
@_hash["type"] = "type"
|
30
|
+
@_hash["user_id"] = "user_id"
|
31
|
+
@_hash["item_id"] = "item_id"
|
32
|
+
@_hash["rating"] = "rating"
|
33
|
+
@_hash["timestamp"] = "timestamp"
|
34
34
|
end
|
35
|
-
@
|
35
|
+
@_hash
|
36
36
|
end
|
37
37
|
|
38
38
|
def initialize(type = nil,
|
39
39
|
user_id = nil,
|
40
40
|
item_id = nil,
|
41
41
|
rating = nil,
|
42
|
-
timestamp = nil
|
43
|
-
additional_properties = {})
|
42
|
+
timestamp = nil)
|
44
43
|
@type = type
|
45
44
|
@user_id = user_id
|
46
45
|
@item_id = item_id
|
47
46
|
@rating = rating
|
48
47
|
@timestamp = timestamp
|
49
|
-
|
50
|
-
# Add additional model properties to the instance
|
51
|
-
additional_properties.each {|name, value| instance_variable_set("@#{name}", value)}
|
52
48
|
end
|
53
49
|
|
54
50
|
# Creates an instance of the object from a hash
|
55
51
|
def self.from_hash(hash)
|
56
|
-
|
57
|
-
nil
|
58
|
-
else
|
59
|
-
# Extract variables from the hash
|
60
|
-
type = hash["type"]
|
61
|
-
user_id = hash["user_id"]
|
62
|
-
item_id = hash["item_id"]
|
63
|
-
rating = hash["rating"]
|
64
|
-
timestamp = hash["timestamp"]
|
52
|
+
return nil unless hash
|
65
53
|
|
66
|
-
|
67
|
-
|
54
|
+
# Extract variables from the hash
|
55
|
+
type = hash['type']
|
56
|
+
user_id = hash['user_id']
|
57
|
+
item_id = hash['item_id']
|
58
|
+
rating = hash['rating']
|
59
|
+
timestamp = hash['timestamp']
|
68
60
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
hash)
|
76
|
-
end
|
61
|
+
# Create object from extracted values
|
62
|
+
Action.new(type,
|
63
|
+
user_id,
|
64
|
+
item_id,
|
65
|
+
rating,
|
66
|
+
timestamp)
|
77
67
|
end
|
78
68
|
end
|
79
69
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module SuggestGrid
|
4
|
+
class ActionsResponse < BaseModel
|
5
|
+
# The number of actions in the response.
|
6
|
+
# @return [Long]
|
7
|
+
attr_accessor :count
|
8
|
+
|
9
|
+
# The total number of actions.
|
10
|
+
# @return [Long]
|
11
|
+
attr_accessor :total_count
|
12
|
+
|
13
|
+
# The total number of actions.
|
14
|
+
# @return [List of Action]
|
15
|
+
attr_accessor :actions
|
16
|
+
|
17
|
+
# A mapping from model property names to API property names
|
18
|
+
def self.names
|
19
|
+
if @_hash.nil?
|
20
|
+
@_hash = {}
|
21
|
+
@_hash["count"] = "count"
|
22
|
+
@_hash["total_count"] = "total_count"
|
23
|
+
@_hash["actions"] = "actions"
|
24
|
+
end
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(count = nil,
|
29
|
+
total_count = nil,
|
30
|
+
actions = nil)
|
31
|
+
@count = count
|
32
|
+
@total_count = total_count
|
33
|
+
@actions = actions
|
34
|
+
end
|
35
|
+
|
36
|
+
# Creates an instance of the object from a hash
|
37
|
+
def self.from_hash(hash)
|
38
|
+
return nil unless hash
|
39
|
+
|
40
|
+
# Extract variables from the hash
|
41
|
+
count = hash['count']
|
42
|
+
total_count = hash['total_count']
|
43
|
+
# Parameter is an array, so we need to iterate through it
|
44
|
+
actions = nil
|
45
|
+
if hash['actions'] != nil
|
46
|
+
actions = Array.new
|
47
|
+
hash['actions'].each{|structure| actions << (Action.from_hash(structure) if structure)}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Create object from extracted values
|
51
|
+
ActionsResponse.new(count,
|
52
|
+
total_count,
|
53
|
+
actions)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -28,22 +28,5 @@ module SuggestGrid
|
|
28
28
|
hash = to_hash
|
29
29
|
hash.to_json(options)
|
30
30
|
end
|
31
|
-
|
32
|
-
# Use to allow additional model properties
|
33
|
-
def method_missing(method_sym, *arguments, &block)
|
34
|
-
method = method_sym.to_s
|
35
|
-
if method.end_with? '='
|
36
|
-
instance_variable_set("@%s" % [method.chomp('=')], arguments.first)
|
37
|
-
elsif instance_variable_defined?("@#{method}") && arguments.empty?
|
38
|
-
instance_variable_get("@#{method}")
|
39
|
-
else
|
40
|
-
super
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
# Override for additional model properties
|
45
|
-
def respond_to?(method_sym, include_private=false)
|
46
|
-
instance_variable_defined?("@#{method_sym}") ? true : super
|
47
|
-
end
|
48
31
|
end
|
49
32
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module SuggestGrid
|
4
|
+
class BulkPostError < BaseModel
|
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
|
+
# 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
|
+
|
28
|
+
def initialize(message = nil,
|
29
|
+
value = nil,
|
30
|
+
error = nil)
|
31
|
+
@message = message
|
32
|
+
@value = value
|
33
|
+
@error = error
|
34
|
+
end
|
35
|
+
|
36
|
+
# Creates an instance of the object from a hash
|
37
|
+
def self.from_hash(hash)
|
38
|
+
return nil unless hash
|
39
|
+
|
40
|
+
# Extract variables from the hash
|
41
|
+
message = hash['message']
|
42
|
+
value = hash['value']
|
43
|
+
error = hash['error']
|
44
|
+
|
45
|
+
# Create object from extracted values
|
46
|
+
BulkPostError.new(message,
|
47
|
+
value,
|
48
|
+
error)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module SuggestGrid
|
4
|
+
class BulkPostResponse < BaseModel
|
5
|
+
# Message of the response.
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :message
|
8
|
+
|
9
|
+
# Message of the response.
|
10
|
+
# @return [List of BulkPostError]
|
11
|
+
attr_accessor :errors
|
12
|
+
|
13
|
+
# A mapping from model property names to API property names
|
14
|
+
def self.names
|
15
|
+
if @_hash.nil?
|
16
|
+
@_hash = {}
|
17
|
+
@_hash["message"] = "message"
|
18
|
+
@_hash["errors"] = "errors"
|
19
|
+
end
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(message = nil,
|
24
|
+
errors = nil)
|
25
|
+
@message = message
|
26
|
+
@errors = errors
|
27
|
+
end
|
28
|
+
|
29
|
+
# Creates an instance of the object from a hash
|
30
|
+
def self.from_hash(hash)
|
31
|
+
return nil unless hash
|
32
|
+
|
33
|
+
# Extract variables from the hash
|
34
|
+
message = hash['message']
|
35
|
+
# Parameter is an array, so we need to iterate through it
|
36
|
+
errors = nil
|
37
|
+
if hash['errors'] != nil
|
38
|
+
errors = Array.new
|
39
|
+
hash['errors'].each{|structure| errors << (BulkPostError.from_hash(structure) if structure)}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Create object from extracted values
|
43
|
+
BulkPostResponse.new(message,
|
44
|
+
errors)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# This file was automatically generated for SuggestGrid by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
module SuggestGrid
|
4
|
+
class DeleteSuccessResponse < BaseModel
|
5
|
+
# Message of the response.
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :message
|
8
|
+
|
9
|
+
# The number of records found.
|
10
|
+
# @return [Long]
|
11
|
+
attr_accessor :found
|
12
|
+
|
13
|
+
# The number of records deleted.
|
14
|
+
# @return [Long]
|
15
|
+
attr_accessor :deleted
|
16
|
+
|
17
|
+
# The number of records failed to be deleted.
|
18
|
+
# @return [Long]
|
19
|
+
attr_accessor :failed
|
20
|
+
|
21
|
+
# A mapping from model property names to API property names
|
22
|
+
def self.names
|
23
|
+
if @_hash.nil?
|
24
|
+
@_hash = {}
|
25
|
+
@_hash["message"] = "message"
|
26
|
+
@_hash["found"] = "found"
|
27
|
+
@_hash["deleted"] = "deleted"
|
28
|
+
@_hash["failed"] = "failed"
|
29
|
+
end
|
30
|
+
@_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(message = nil,
|
34
|
+
found = nil,
|
35
|
+
deleted = nil,
|
36
|
+
failed = nil)
|
37
|
+
@message = message
|
38
|
+
@found = found
|
39
|
+
@deleted = deleted
|
40
|
+
@failed = failed
|
41
|
+
end
|
42
|
+
|
43
|
+
# Creates an instance of the object from a hash
|
44
|
+
def self.from_hash(hash)
|
45
|
+
return nil unless hash
|
46
|
+
|
47
|
+
# Extract variables from the hash
|
48
|
+
message = hash['message']
|
49
|
+
found = hash['found']
|
50
|
+
deleted = hash['deleted']
|
51
|
+
failed = hash['failed']
|
52
|
+
|
53
|
+
# Create object from extracted values
|
54
|
+
DeleteSuccessResponse.new(message,
|
55
|
+
found,
|
56
|
+
deleted,
|
57
|
+
failed)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|