apimatic-gp-sdk 0.0.1
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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +155 -0
- data/bin/console +15 -0
- data/lib/batches/api_helper.rb +10 -0
- data/lib/batches/apis/base_api.rb +67 -0
- data/lib/batches/apis/close_a_batch_api.rb +111 -0
- data/lib/batches/apis/get_a_batch_api.rb +70 -0
- data/lib/batches/apis/get_transactions_within_a_batch_api.rb +69 -0
- data/lib/batches/client.rb +72 -0
- data/lib/batches/configuration.rb +166 -0
- data/lib/batches/exceptions/api_exception.rb +21 -0
- data/lib/batches/exceptions/batches400_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches401_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches403_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches500_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches501_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches502_error_exception.rb +62 -0
- data/lib/batches/exceptions/batches504_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions400_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions401_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions403_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions500_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions501_error_exception.rb +61 -0
- data/lib/batches/exceptions/batches_transactions502_error_exception.rb +62 -0
- data/lib/batches/exceptions/batches_transactions504_error_exception.rb +61 -0
- data/lib/batches/http/api_response.rb +19 -0
- data/lib/batches/http/http_call_back.rb +10 -0
- data/lib/batches/http/http_method_enum.rb +10 -0
- data/lib/batches/http/http_request.rb +10 -0
- data/lib/batches/http/http_response.rb +10 -0
- data/lib/batches/http/proxy_settings.rb +22 -0
- data/lib/batches/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/batches/logging/sdk_logger.rb +17 -0
- data/lib/batches/models/action.rb +125 -0
- data/lib/batches/models/authentication_invalid401.rb +102 -0
- data/lib/batches/models/avs_address_result_batches_transactions_payment_method_card_avs_address_result.rb +40 -0
- data/lib/batches/models/avs_postal_code_result_batches_transactions_payment_method_card_avs_postal_code_result.rb +40 -0
- data/lib/batches/models/base_model.rb +110 -0
- data/lib/batches/models/batches_request.rb +142 -0
- data/lib/batches/models/brand_batches_brand_breakdown_brand.rb +56 -0
- data/lib/batches/models/brand_batches_transactions_payment_method_card_brand.rb +56 -0
- data/lib/batches/models/brand_breakdown_item.rb +159 -0
- data/lib/batches/models/card.rb +170 -0
- data/lib/batches/models/channel_batches_channel.rb +44 -0
- data/lib/batches/models/close_response.rb +356 -0
- data/lib/batches/models/currency_batches_transactions_currency.rb +60 -0
- data/lib/batches/models/cvv_result_batches_transactions_payment_method_card_cvv_result.rb +40 -0
- data/lib/batches/models/detailed_error_code.rb +26 -0
- data/lib/batches/models/detailed_error_code1.rb +36 -0
- data/lib/batches/models/detailed_error_code2.rb +36 -0
- data/lib/batches/models/detailed_error_code3.rb +26 -0
- data/lib/batches/models/detailed_error_code4.rb +26 -0
- data/lib/batches/models/detailed_error_code5.rb +26 -0
- data/lib/batches/models/detailed_error_code6.rb +26 -0
- data/lib/batches/models/entry_mode_batches_transactions_payment_method_entry_mode.rb +104 -0
- data/lib/batches/models/error_code.rb +52 -0
- data/lib/batches/models/error_code1.rb +26 -0
- data/lib/batches/models/error_code2.rb +26 -0
- data/lib/batches/models/error_code3.rb +26 -0
- data/lib/batches/models/error_code4.rb +26 -0
- data/lib/batches/models/error_code5.rb +27 -0
- data/lib/batches/models/error_code6.rb +26 -0
- data/lib/batches/models/filter.rb +76 -0
- data/lib/batches/models/funding_batches_transactions_payment_method_card_funding.rb +59 -0
- data/lib/batches/models/funding_credit.rb +85 -0
- data/lib/batches/models/funding_credit1.rb +85 -0
- data/lib/batches/models/funding_credit5.rb +85 -0
- data/lib/batches/models/funding_debit.rb +85 -0
- data/lib/batches/models/funding_debit1.rb +85 -0
- data/lib/batches/models/funding_debit5.rb +85 -0
- data/lib/batches/models/get_response.rb +331 -0
- data/lib/batches/models/host_breakdown_item.rb +128 -0
- data/lib/batches/models/not_authorized403.rb +102 -0
- data/lib/batches/models/obj_request_invalid400.rb +102 -0
- data/lib/batches/models/payment_method.rb +167 -0
- data/lib/batches/models/payment_method2.rb +52 -0
- data/lib/batches/models/payment_methods_batches_payment_method.rb +52 -0
- data/lib/batches/models/refunds.rb +85 -0
- data/lib/batches/models/refunds1.rb +85 -0
- data/lib/batches/models/result_code_batches_action_result_code.rb +26 -0
- data/lib/batches/models/sales.rb +85 -0
- data/lib/batches/models/sales1.rb +85 -0
- data/lib/batches/models/server_error500.rb +102 -0
- data/lib/batches/models/server_timeout504.rb +102 -0
- data/lib/batches/models/status_batches_status.rb +38 -0
- data/lib/batches/models/status_batches_transactions_status.rb +39 -0
- data/lib/batches/models/transaction.rb +205 -0
- data/lib/batches/models/transaction_batch_response.rb +198 -0
- data/lib/batches/models/type_batches_action_type.rb +40 -0
- data/lib/batches/models/type_batches_transactions_type.rb +40 -0
- data/lib/batches/models/unknown_platform_error502.rb +103 -0
- data/lib/batches/models/unknown_server_error501.rb +102 -0
- data/lib/batches/utilities/date_time_helper.rb +11 -0
- data/lib/batches/utilities/file_wrapper.rb +28 -0
- data/lib/batches.rb +128 -0
- metadata +180 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Not Authenticated
|
|
8
|
+
class BatchesTransactions401ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This action failed as token in the request is not valid.
|
|
13
|
+
# @return [ErrorCode1]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode1]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# Unique Text describing the specific error.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# The constructor.
|
|
25
|
+
# @param [String] reason The reason for raising an exception.
|
|
26
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
27
|
+
def initialize(reason, response)
|
|
28
|
+
super(reason, response)
|
|
29
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
30
|
+
unbox(hash)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Populates this object by extracting properties from a hash.
|
|
34
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
35
|
+
# response body.
|
|
36
|
+
def unbox(hash)
|
|
37
|
+
return nil unless hash
|
|
38
|
+
|
|
39
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
40
|
+
@detailed_error_code =
|
|
41
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
42
|
+
@detailed_error_description =
|
|
43
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Provides a human-readable string representation of the object.
|
|
47
|
+
def to_s
|
|
48
|
+
class_name = self.class.name.split('::').last
|
|
49
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
50
|
+
" detailed_error_description: #{@detailed_error_description}>"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
54
|
+
def inspect
|
|
55
|
+
class_name = self.class.name.split('::').last
|
|
56
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
57
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
58
|
+
" #{@detailed_error_description.inspect}>"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Forbidden
|
|
8
|
+
class BatchesTransactions403ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This action is not authorized with the credentials being used.
|
|
13
|
+
# @return [ErrorCode2]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode2]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# Unique Text describing the specific error.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# The constructor.
|
|
25
|
+
# @param [String] reason The reason for raising an exception.
|
|
26
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
27
|
+
def initialize(reason, response)
|
|
28
|
+
super(reason, response)
|
|
29
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
30
|
+
unbox(hash)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Populates this object by extracting properties from a hash.
|
|
34
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
35
|
+
# response body.
|
|
36
|
+
def unbox(hash)
|
|
37
|
+
return nil unless hash
|
|
38
|
+
|
|
39
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
40
|
+
@detailed_error_code =
|
|
41
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
42
|
+
@detailed_error_description =
|
|
43
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Provides a human-readable string representation of the object.
|
|
47
|
+
def to_s
|
|
48
|
+
class_name = self.class.name.split('::').last
|
|
49
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
50
|
+
" detailed_error_description: #{@detailed_error_description}>"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
54
|
+
def inspect
|
|
55
|
+
class_name = self.class.name.split('::').last
|
|
56
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
57
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
58
|
+
" #{@detailed_error_description.inspect}>"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Internal Server Error
|
|
8
|
+
class BatchesTransactions500ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This indicates an unexpected issue occurred on the Global Payments system.
|
|
13
|
+
# @return [ErrorCode3]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode3]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# Unique Text describing the specific error.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# The constructor.
|
|
25
|
+
# @param [String] reason The reason for raising an exception.
|
|
26
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
27
|
+
def initialize(reason, response)
|
|
28
|
+
super(reason, response)
|
|
29
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
30
|
+
unbox(hash)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Populates this object by extracting properties from a hash.
|
|
34
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
35
|
+
# response body.
|
|
36
|
+
def unbox(hash)
|
|
37
|
+
return nil unless hash
|
|
38
|
+
|
|
39
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
40
|
+
@detailed_error_code =
|
|
41
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
42
|
+
@detailed_error_description =
|
|
43
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Provides a human-readable string representation of the object.
|
|
47
|
+
def to_s
|
|
48
|
+
class_name = self.class.name.split('::').last
|
|
49
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
50
|
+
" detailed_error_description: #{@detailed_error_description}>"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
54
|
+
def inspect
|
|
55
|
+
class_name = self.class.name.split('::').last
|
|
56
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
57
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
58
|
+
" #{@detailed_error_description.inspect}>"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Not implemented
|
|
8
|
+
class BatchesTransactions501ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This is an error not yet handled or mapped properly.
|
|
13
|
+
# @return [ErrorCode4]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode4]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# Unique Text describing the specific error not yet handled.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# The constructor.
|
|
25
|
+
# @param [String] reason The reason for raising an exception.
|
|
26
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
27
|
+
def initialize(reason, response)
|
|
28
|
+
super(reason, response)
|
|
29
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
30
|
+
unbox(hash)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Populates this object by extracting properties from a hash.
|
|
34
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
35
|
+
# response body.
|
|
36
|
+
def unbox(hash)
|
|
37
|
+
return nil unless hash
|
|
38
|
+
|
|
39
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
40
|
+
@detailed_error_code =
|
|
41
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
42
|
+
@detailed_error_description =
|
|
43
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Provides a human-readable string representation of the object.
|
|
47
|
+
def to_s
|
|
48
|
+
class_name = self.class.name.split('::').last
|
|
49
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
50
|
+
" detailed_error_description: #{@detailed_error_description}>"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
54
|
+
def inspect
|
|
55
|
+
class_name = self.class.name.split('::').last
|
|
56
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
57
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
58
|
+
" #{@detailed_error_description.inspect}>"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Bad Gateway
|
|
8
|
+
class BatchesTransactions502ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This is an error indicating there was an issue connecting to a partner
|
|
13
|
+
# system..
|
|
14
|
+
# @return [ErrorCode5]
|
|
15
|
+
attr_accessor :error_code
|
|
16
|
+
|
|
17
|
+
# Unique reference to identify the error.
|
|
18
|
+
# @return [DetailedErrorCode5]
|
|
19
|
+
attr_accessor :detailed_error_code
|
|
20
|
+
|
|
21
|
+
# Authentication error—Verify and correct credentials.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :detailed_error_description
|
|
24
|
+
|
|
25
|
+
# The constructor.
|
|
26
|
+
# @param [String] reason The reason for raising an exception.
|
|
27
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
28
|
+
def initialize(reason, response)
|
|
29
|
+
super(reason, response)
|
|
30
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
31
|
+
unbox(hash)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Populates this object by extracting properties from a hash.
|
|
35
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
36
|
+
# response body.
|
|
37
|
+
def unbox(hash)
|
|
38
|
+
return nil unless hash
|
|
39
|
+
|
|
40
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
41
|
+
@detailed_error_code =
|
|
42
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
43
|
+
@detailed_error_description =
|
|
44
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Provides a human-readable string representation of the object.
|
|
48
|
+
def to_s
|
|
49
|
+
class_name = self.class.name.split('::').last
|
|
50
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
51
|
+
" detailed_error_description: #{@detailed_error_description}>"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
55
|
+
def inspect
|
|
56
|
+
class_name = self.class.name.split('::').last
|
|
57
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
58
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
59
|
+
" #{@detailed_error_description.inspect}>"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Timeout
|
|
8
|
+
class BatchesTransactions504ErrorException < APIException
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# This is an error indicating there was a timeout issue to another system.
|
|
13
|
+
# @return [ErrorCode6]
|
|
14
|
+
attr_accessor :error_code
|
|
15
|
+
|
|
16
|
+
# Unique reference to identify the error.
|
|
17
|
+
# @return [DetailedErrorCode6]
|
|
18
|
+
attr_accessor :detailed_error_code
|
|
19
|
+
|
|
20
|
+
# No response from payment method provider.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :detailed_error_description
|
|
23
|
+
|
|
24
|
+
# The constructor.
|
|
25
|
+
# @param [String] reason The reason for raising an exception.
|
|
26
|
+
# @param [HttpResponse] response The HttpReponse of the API call.
|
|
27
|
+
def initialize(reason, response)
|
|
28
|
+
super(reason, response)
|
|
29
|
+
hash = APIHelper.json_deserialize(@response.raw_body)
|
|
30
|
+
unbox(hash)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Populates this object by extracting properties from a hash.
|
|
34
|
+
# @param [Hash] hash The deserialized response sent by the server in the
|
|
35
|
+
# response body.
|
|
36
|
+
def unbox(hash)
|
|
37
|
+
return nil unless hash
|
|
38
|
+
|
|
39
|
+
@error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
|
|
40
|
+
@detailed_error_code =
|
|
41
|
+
hash.key?('detailed_error_code') ? hash['detailed_error_code'] : SKIP
|
|
42
|
+
@detailed_error_description =
|
|
43
|
+
hash.key?('detailed_error_description') ? hash['detailed_error_description'] : SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Provides a human-readable string representation of the object.
|
|
47
|
+
def to_s
|
|
48
|
+
class_name = self.class.name.split('::').last
|
|
49
|
+
"<#{class_name} error_code: #{@error_code}, detailed_error_code: #{@detailed_error_code},"\
|
|
50
|
+
" detailed_error_description: #{@detailed_error_description}>"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
54
|
+
def inspect
|
|
55
|
+
class_name = self.class.name.split('::').last
|
|
56
|
+
"<#{class_name} error_code: #{@error_code.inspect}, detailed_error_code:"\
|
|
57
|
+
" #{@detailed_error_code.inspect}, detailed_error_description:"\
|
|
58
|
+
" #{@detailed_error_description.inspect}>"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Http response received.
|
|
8
|
+
class ApiResponse < CoreLibrary::ApiResponse
|
|
9
|
+
# The constructor
|
|
10
|
+
# @param [HttpResponse] http_response The original, raw response from the api.
|
|
11
|
+
# @param [Object] data The data field specified for the response.
|
|
12
|
+
# @param [Array<String>] errors Any errors returned by the server.
|
|
13
|
+
def initialize(http_response,
|
|
14
|
+
data: nil,
|
|
15
|
+
errors: nil)
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
##
|
|
8
|
+
# ProxySettings encapsulates HTTP proxy configuration for Faraday,
|
|
9
|
+
# including optional basic authentication.
|
|
10
|
+
#
|
|
11
|
+
class ProxySettings < CoreLibrary::ProxySettings
|
|
12
|
+
def self.from_env
|
|
13
|
+
address = ENV['PROXY_ADDRESS']
|
|
14
|
+
port = ENV['PROXY_PORT']
|
|
15
|
+
username = ENV['PROXY_USERNAME']
|
|
16
|
+
password = ENV['PROXY_PASSWORD']
|
|
17
|
+
return nil if address.nil? || address.strip.empty?
|
|
18
|
+
|
|
19
|
+
new(address: address, port: port, username: username, password: password)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Initializes a new instance of RequestLoggingConfiguration.
|
|
8
|
+
class RequestLoggingConfiguration < CoreLibrary::ApiRequestLoggingConfiguration
|
|
9
|
+
# @param log_body [Boolean] Indicates whether the message body should be logged. Default is false.
|
|
10
|
+
# @param log_headers [Boolean] Indicates whether the message headers should be logged. Default is false.
|
|
11
|
+
# @param headers_to_exclude [Array<String>] Array of headers not displayed in logging. Default is an empty array.
|
|
12
|
+
# @param headers_to_include [Array<String>] Array of headers to be displayed in logging. Default is an empty array.
|
|
13
|
+
# @param headers_to_unmask [Array<String>] Array of headers which values are non-sensitive to display in logging.
|
|
14
|
+
# Default is an empty array.
|
|
15
|
+
def initialize(log_body: false, log_headers: false, headers_to_include: nil,
|
|
16
|
+
headers_to_exclude: nil, headers_to_unmask: nil,
|
|
17
|
+
include_query_in_path: false)
|
|
18
|
+
super(
|
|
19
|
+
log_body,
|
|
20
|
+
log_headers,
|
|
21
|
+
headers_to_exclude,
|
|
22
|
+
headers_to_include,
|
|
23
|
+
headers_to_unmask,
|
|
24
|
+
include_query_in_path
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
|
|
29
|
+
headers_to_exclude: nil, headers_to_unmask: nil, include_query_in_path: nil)
|
|
30
|
+
log_body ||= self.log_body
|
|
31
|
+
log_headers ||= self.log_headers
|
|
32
|
+
headers_to_include ||= self.headers_to_include
|
|
33
|
+
headers_to_exclude ||= self.headers_to_exclude
|
|
34
|
+
headers_to_unmask ||= self.headers_to_unmask
|
|
35
|
+
include_query_in_path ||= self.include_query_in_path
|
|
36
|
+
|
|
37
|
+
RequestLoggingConfiguration.new(
|
|
38
|
+
log_body: log_body,
|
|
39
|
+
log_headers: log_headers,
|
|
40
|
+
headers_to_include: headers_to_include,
|
|
41
|
+
headers_to_exclude: headers_to_exclude,
|
|
42
|
+
headers_to_unmask: headers_to_unmask,
|
|
43
|
+
include_query_in_path: include_query_in_path
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def self.from_env
|
|
48
|
+
log_body = ENV['REQUEST_LOG_BODY']
|
|
49
|
+
log_headers = ENV['REQUEST_LOG_HEADERS']
|
|
50
|
+
headers_to_include = ENV['REQUEST_HEADERS_TO_INCLUDE']
|
|
51
|
+
headers_to_exclude = ENV['REQUEST_HEADERS_TO_EXCLUDE']
|
|
52
|
+
headers_to_unmask = ENV['REQUEST_HEADERS_TO_UNMASK']
|
|
53
|
+
include_query_in_path = ENV['REQUEST_INCLUDE_QUERY_IN_PATH']
|
|
54
|
+
|
|
55
|
+
new(
|
|
56
|
+
log_body: log_body,
|
|
57
|
+
log_headers: log_headers,
|
|
58
|
+
headers_to_include: headers_to_include,
|
|
59
|
+
headers_to_exclude: headers_to_exclude,
|
|
60
|
+
headers_to_unmask: headers_to_unmask,
|
|
61
|
+
include_query_in_path: include_query_in_path
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.any_logging_configured?
|
|
66
|
+
%w[
|
|
67
|
+
REQUEST_LOG_BODY
|
|
68
|
+
REQUEST_LOG_HEADERS
|
|
69
|
+
REQUEST_HEADERS_TO_INCLUDE
|
|
70
|
+
REQUEST_HEADERS_TO_EXCLUDE
|
|
71
|
+
REQUEST_HEADERS_TO_UNMASK
|
|
72
|
+
REQUEST_INCLUDE_QUERY_IN_PATH
|
|
73
|
+
].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Initializes a new instance of ResponseLoggingConfiguration.
|
|
78
|
+
class ResponseLoggingConfiguration < CoreLibrary::ApiResponseLoggingConfiguration
|
|
79
|
+
def initialize(log_body: false, log_headers: false, headers_to_include: nil,
|
|
80
|
+
headers_to_exclude: nil, headers_to_unmask: nil)
|
|
81
|
+
super(
|
|
82
|
+
log_body,
|
|
83
|
+
log_headers,
|
|
84
|
+
headers_to_exclude,
|
|
85
|
+
headers_to_include,
|
|
86
|
+
headers_to_unmask
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
|
|
91
|
+
headers_to_exclude: nil, headers_to_unmask: nil)
|
|
92
|
+
log_body ||= self.log_body
|
|
93
|
+
log_headers ||= self.log_headers
|
|
94
|
+
headers_to_include ||= self.headers_to_include
|
|
95
|
+
headers_to_exclude ||= self.headers_to_exclude
|
|
96
|
+
headers_to_unmask ||= self.headers_to_unmask
|
|
97
|
+
|
|
98
|
+
ResponseLoggingConfiguration.new(
|
|
99
|
+
log_body: log_body,
|
|
100
|
+
log_headers: log_headers,
|
|
101
|
+
headers_to_include: headers_to_include,
|
|
102
|
+
headers_to_exclude: headers_to_exclude,
|
|
103
|
+
headers_to_unmask: headers_to_unmask
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def self.from_env
|
|
108
|
+
log_body = ENV['RESPONSE_LOG_BODY']
|
|
109
|
+
log_headers = ENV['RESPONSE_LOG_HEADERS']
|
|
110
|
+
headers_to_include = ENV['RESPONSE_HEADERS_TO_INCLUDE']
|
|
111
|
+
headers_to_exclude = ENV['RESPONSE_HEADERS_TO_EXCLUDE']
|
|
112
|
+
headers_to_unmask = ENV['RESPONSE_HEADERS_TO_UNMASK']
|
|
113
|
+
|
|
114
|
+
new(
|
|
115
|
+
log_body: log_body,
|
|
116
|
+
log_headers: log_headers,
|
|
117
|
+
headers_to_include: headers_to_include,
|
|
118
|
+
headers_to_exclude: headers_to_exclude,
|
|
119
|
+
headers_to_unmask: headers_to_unmask
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def self.any_logging_configured?
|
|
124
|
+
%w[
|
|
125
|
+
RESPONSE_LOG_BODY
|
|
126
|
+
RESPONSE_LOG_HEADERS
|
|
127
|
+
RESPONSE_HEADERS_TO_INCLUDE
|
|
128
|
+
RESPONSE_HEADERS_TO_EXCLUDE
|
|
129
|
+
RESPONSE_HEADERS_TO_UNMASK
|
|
130
|
+
].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Initializes a new instance of LoggingConfiguration.
|
|
135
|
+
class LoggingConfiguration < CoreLibrary::ApiLoggingConfiguration
|
|
136
|
+
def initialize(logger: nil, log_level: nil, mask_sensitive_headers: true,
|
|
137
|
+
request_logging_config: nil,
|
|
138
|
+
response_logging_config: nil)
|
|
139
|
+
request_logging_config ||= RequestLoggingConfiguration.new
|
|
140
|
+
response_logging_config ||= ResponseLoggingConfiguration.new
|
|
141
|
+
super(
|
|
142
|
+
logger,
|
|
143
|
+
log_level,
|
|
144
|
+
request_logging_config,
|
|
145
|
+
response_logging_config,
|
|
146
|
+
mask_sensitive_headers
|
|
147
|
+
)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def clone_with(logger: nil, log_level: nil, mask_sensitive_headers: nil,
|
|
151
|
+
request_logging_config: nil, response_logging_config: nil)
|
|
152
|
+
logger ||= self.logger
|
|
153
|
+
log_level ||= self.log_level
|
|
154
|
+
mask_sensitive_headers ||= self.mask_sensitive_headers
|
|
155
|
+
request_logging_config ||= self.request_logging_config.clone
|
|
156
|
+
response_logging_config ||= self.response_logging_config.clone
|
|
157
|
+
|
|
158
|
+
LoggingConfiguration.new(
|
|
159
|
+
logger: logger,
|
|
160
|
+
log_level: log_level,
|
|
161
|
+
mask_sensitive_headers: mask_sensitive_headers,
|
|
162
|
+
request_logging_config: request_logging_config,
|
|
163
|
+
response_logging_config: response_logging_config
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def self.from_env
|
|
168
|
+
log_level = ENV['LOG_LEVEL']
|
|
169
|
+
mask_sensitive_headers = ENV['MASK_SENSITIVE_HEADERS']
|
|
170
|
+
|
|
171
|
+
new(
|
|
172
|
+
log_level: log_level,
|
|
173
|
+
mask_sensitive_headers: mask_sensitive_headers,
|
|
174
|
+
request_logging_config: RequestLoggingConfiguration.from_env,
|
|
175
|
+
response_logging_config: ResponseLoggingConfiguration.from_env
|
|
176
|
+
)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def self.any_logging_configured?
|
|
180
|
+
RequestLoggingConfiguration.any_logging_configured? ||
|
|
181
|
+
ResponseLoggingConfiguration.any_logging_configured? ||
|
|
182
|
+
ENV.key?('LOG_LEVEL') ||
|
|
183
|
+
ENV.key?('MASK_SENSITIVE_HEADERS')
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# batches
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Batches
|
|
7
|
+
# Represents the generic logger facade
|
|
8
|
+
class AbstractLogger < Logger
|
|
9
|
+
# Logs a message with a specified log level and additional parameters.
|
|
10
|
+
# @param level [Symbol] The log level of the message.
|
|
11
|
+
# @param message [String] The message to log.
|
|
12
|
+
# @param params [Hash] Additional parameters to include in the log message.
|
|
13
|
+
def log(level, message, params)
|
|
14
|
+
raise NotImplementedError, 'This method needs to be implemented in a child class.'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|