dna-apimatic-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.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +172 -0
  4. data/bin/console +15 -0
  5. data/lib/dna_payments_partner_reporting_settlement_ap_is/api_helper.rb +10 -0
  6. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/authentication_api.rb +53 -0
  7. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/base_api.rb +67 -0
  8. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/ecommerce_transactions_api.rb +113 -0
  9. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/merchants_api.rb +79 -0
  10. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/oauth_authorization_api.rb +44 -0
  11. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/pos_transactions_api.rb +128 -0
  12. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/settlements_api.rb +82 -0
  13. data/lib/dna_payments_partner_reporting_settlement_ap_is/client.rb +110 -0
  14. data/lib/dna_payments_partner_reporting_settlement_ap_is/configuration.rb +177 -0
  15. data/lib/dna_payments_partner_reporting_settlement_ap_is/exceptions/api_exception.rb +21 -0
  16. data/lib/dna_payments_partner_reporting_settlement_ap_is/exceptions/error_exception.rb +51 -0
  17. data/lib/dna_payments_partner_reporting_settlement_ap_is/exceptions/oauth_provider_exception.rb +64 -0
  18. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/api_response.rb +19 -0
  19. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/auth/oauth_2.rb +156 -0
  20. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_call_back.rb +10 -0
  21. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_method_enum.rb +10 -0
  22. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_request.rb +10 -0
  23. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_response.rb +10 -0
  24. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/proxy_settings.rb +22 -0
  25. data/lib/dna_payments_partner_reporting_settlement_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
  26. data/lib/dna_payments_partner_reporting_settlement_ap_is/logging/sdk_logger.rb +17 -0
  27. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/auth_token_request.rb +97 -0
  28. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/auth_token_response.rb +115 -0
  29. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/base_model.rb +110 -0
  30. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/capture_method.rb +72 -0
  31. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/card_type.rb +36 -0
  32. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/ecommerce_transaction.rb +528 -0
  33. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/ecommerce_transactions_response.rb +94 -0
  34. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/grant_type.rb +26 -0
  35. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v1.rb +85 -0
  36. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb +138 -0
  37. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/merchants_v2_response.rb +94 -0
  38. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/oauth_provider_error.rb +62 -0
  39. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/oauth_scope.rb +26 -0
  40. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/oauth_token.rb +96 -0
  41. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/operation.rb +48 -0
  42. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/pos_transaction.rb +298 -0
  43. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/pos_transactions_response.rb +105 -0
  44. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/processor.rb +36 -0
  45. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/scope.rb +26 -0
  46. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/search_by.rb +36 -0
  47. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/settlement.rb +314 -0
  48. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/settlements_response.rb +94 -0
  49. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/status.rb +46 -0
  50. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/status1.rb +36 -0
  51. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/status2.rb +36 -0
  52. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb +141 -0
  53. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/token_type.rb +26 -0
  54. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/transaction_type.rb +201 -0
  55. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/type.rb +36 -0
  56. data/lib/dna_payments_partner_reporting_settlement_ap_is/utilities/date_time_helper.rb +11 -0
  57. data/lib/dna_payments_partner_reporting_settlement_ap_is/utilities/file_wrapper.rb +28 -0
  58. data/lib/dna_payments_partner_reporting_settlement_ap_is.rb +125 -0
  59. metadata +142 -0
@@ -0,0 +1,85 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # MerchantV1 Model.
8
+ class MerchantV1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique ID for the merchant, allocated by DNA Payments.
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # Name of the merchant.
17
+ # @return [String]
18
+ attr_accessor :name
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['id'] = 'id'
24
+ @_hash['name'] = 'name'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ id
32
+ name
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(id: SKIP, name: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @id = id unless id == SKIP
46
+ @name = name unless name == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ id = hash.key?('id') ? hash['id'] : SKIP
56
+ name = hash.key?('name') ? hash['name'] : SKIP
57
+
58
+ # Create a new hash for additional properties, removing known properties.
59
+ new_hash = hash.reject { |k, _| names.value?(k) }
60
+
61
+ additional_properties = APIHelper.get_additional_properties(
62
+ new_hash, proc { |value| value }
63
+ )
64
+
65
+ # Create object from extracted values.
66
+ MerchantV1.new(id: id,
67
+ name: name,
68
+ additional_properties: additional_properties)
69
+ end
70
+
71
+ # Provides a human-readable string representation of the object.
72
+ def to_s
73
+ class_name = self.class.name.split('::').last
74
+ "<#{class_name} id: #{@id}, name: #{@name}, additional_properties:"\
75
+ " #{@additional_properties}>"
76
+ end
77
+
78
+ # Provides a debugging-friendly string with detailed object information.
79
+ def inspect
80
+ class_name = self.class.name.split('::').last
81
+ "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, additional_properties:"\
82
+ " #{@additional_properties}>"
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,138 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # MerchantV2 Model.
8
+ class MerchantV2 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Merchant descriptor as it appears on the consumer's bank statement for DNA
13
+ # Acquiring.
14
+ # @return [String]
15
+ attr_accessor :descriptor
16
+
17
+ # Unique ID for the merchant, allocated by DNA Payments.
18
+ # @return [String]
19
+ attr_accessor :id
20
+
21
+ # Name of the merchant.
22
+ # @return [String]
23
+ attr_accessor :name
24
+
25
+ # Whether the merchant is active.
26
+ # @return [TrueClass | FalseClass]
27
+ attr_accessor :is_active
28
+
29
+ # Unique ID allocated by DNA Payments to the merchant account; appears on
30
+ # the merchant bank statement when payments/settlements are made.
31
+ # @return [String]
32
+ attr_accessor :reconciliation_id
33
+
34
+ # List of all Terminal IDs configured for the merchant.
35
+ # @return [Array[Terminal]]
36
+ attr_accessor :terminals
37
+
38
+ # A mapping from model property names to API property names.
39
+ def self.names
40
+ @_hash = {} if @_hash.nil?
41
+ @_hash['descriptor'] = 'descriptor'
42
+ @_hash['id'] = 'id'
43
+ @_hash['name'] = 'name'
44
+ @_hash['is_active'] = 'isActive'
45
+ @_hash['reconciliation_id'] = 'reconciliationId'
46
+ @_hash['terminals'] = 'terminals'
47
+ @_hash
48
+ end
49
+
50
+ # An array for optional fields
51
+ def self.optionals
52
+ %w[
53
+ descriptor
54
+ id
55
+ name
56
+ is_active
57
+ reconciliation_id
58
+ terminals
59
+ ]
60
+ end
61
+
62
+ # An array for nullable fields
63
+ def self.nullables
64
+ []
65
+ end
66
+
67
+ def initialize(descriptor: SKIP, id: SKIP, name: SKIP, is_active: SKIP,
68
+ reconciliation_id: SKIP, terminals: SKIP,
69
+ additional_properties: nil)
70
+ # Add additional model properties to the instance
71
+ additional_properties = {} if additional_properties.nil?
72
+
73
+ @descriptor = descriptor unless descriptor == SKIP
74
+ @id = id unless id == SKIP
75
+ @name = name unless name == SKIP
76
+ @is_active = is_active unless is_active == SKIP
77
+ @reconciliation_id = reconciliation_id unless reconciliation_id == SKIP
78
+ @terminals = terminals unless terminals == SKIP
79
+ @additional_properties = additional_properties
80
+ end
81
+
82
+ # Creates an instance of the object from a hash.
83
+ def self.from_hash(hash)
84
+ return nil unless hash
85
+
86
+ # Extract variables from the hash.
87
+ descriptor = hash.key?('descriptor') ? hash['descriptor'] : SKIP
88
+ id = hash.key?('id') ? hash['id'] : SKIP
89
+ name = hash.key?('name') ? hash['name'] : SKIP
90
+ is_active = hash.key?('isActive') ? hash['isActive'] : SKIP
91
+ reconciliation_id =
92
+ hash.key?('reconciliationId') ? hash['reconciliationId'] : SKIP
93
+ # Parameter is an array, so we need to iterate through it
94
+ terminals = nil
95
+ unless hash['terminals'].nil?
96
+ terminals = []
97
+ hash['terminals'].each do |structure|
98
+ terminals << (Terminal.from_hash(structure) if structure)
99
+ end
100
+ end
101
+
102
+ terminals = SKIP unless hash.key?('terminals')
103
+
104
+ # Create a new hash for additional properties, removing known properties.
105
+ new_hash = hash.reject { |k, _| names.value?(k) }
106
+
107
+ additional_properties = APIHelper.get_additional_properties(
108
+ new_hash, proc { |value| value }
109
+ )
110
+
111
+ # Create object from extracted values.
112
+ MerchantV2.new(descriptor: descriptor,
113
+ id: id,
114
+ name: name,
115
+ is_active: is_active,
116
+ reconciliation_id: reconciliation_id,
117
+ terminals: terminals,
118
+ additional_properties: additional_properties)
119
+ end
120
+
121
+ # Provides a human-readable string representation of the object.
122
+ def to_s
123
+ class_name = self.class.name.split('::').last
124
+ "<#{class_name} descriptor: #{@descriptor}, id: #{@id}, name: #{@name}, is_active:"\
125
+ " #{@is_active}, reconciliation_id: #{@reconciliation_id}, terminals: #{@terminals},"\
126
+ " additional_properties: #{@additional_properties}>"
127
+ end
128
+
129
+ # Provides a debugging-friendly string with detailed object information.
130
+ def inspect
131
+ class_name = self.class.name.split('::').last
132
+ "<#{class_name} descriptor: #{@descriptor.inspect}, id: #{@id.inspect}, name:"\
133
+ " #{@name.inspect}, is_active: #{@is_active.inspect}, reconciliation_id:"\
134
+ " #{@reconciliation_id.inspect}, terminals: #{@terminals.inspect}, additional_properties:"\
135
+ " #{@additional_properties}>"
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,94 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # MerchantsV2Response Model.
8
+ class MerchantsV2Response < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Array[MerchantV2]]
14
+ attr_accessor :data
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Integer]
18
+ attr_accessor :total_count
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['data'] = 'data'
24
+ @_hash['total_count'] = 'totalCount'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ data
32
+ total_count
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(data: SKIP, total_count: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @data = data unless data == SKIP
46
+ @total_count = total_count unless total_count == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ # Parameter is an array, so we need to iterate through it
56
+ data = nil
57
+ unless hash['data'].nil?
58
+ data = []
59
+ hash['data'].each do |structure|
60
+ data << (MerchantV2.from_hash(structure) if structure)
61
+ end
62
+ end
63
+
64
+ data = SKIP unless hash.key?('data')
65
+ total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ MerchantsV2Response.new(data: data,
76
+ total_count: total_count,
77
+ additional_properties: additional_properties)
78
+ end
79
+
80
+ # Provides a human-readable string representation of the object.
81
+ def to_s
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} data: #{@data}, total_count: #{@total_count}, additional_properties:"\
84
+ " #{@additional_properties}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} data: #{@data.inspect}, total_count: #{@total_count.inspect},"\
91
+ " additional_properties: #{@additional_properties}>"
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,62 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # OAuth 2 Authorization error codes
8
+ class OauthProviderError
9
+ OAUTH_PROVIDER_ERROR = [
10
+ # The request is missing a required parameter, includes an unsupported
11
+ # parameter value (other than grant type), repeats a parameter, includes
12
+ # multiple credentials, utilizes more than one mechanism for
13
+ # authenticating the client, or is otherwise malformed.
14
+ INVALID_REQUEST = 'invalid_request'.freeze,
15
+
16
+ # Client authentication failed (e.g., unknown client, no client
17
+ # authentication included, or unsupported authentication method).
18
+ INVALID_CLIENT = 'invalid_client'.freeze,
19
+
20
+ # The provided authorization grant (e.g., authorization code, resource
21
+ # owner credentials) or refresh token is invalid, expired, revoked, does
22
+ # not match the redirection URI used in the authorization request, or was
23
+ # issued to another client.
24
+ INVALID_GRANT = 'invalid_grant'.freeze,
25
+
26
+ # The authenticated client is not authorized to use this authorization
27
+ # grant type.
28
+ UNAUTHORIZED_CLIENT = 'unauthorized_client'.freeze,
29
+
30
+ # The authorization grant type is not supported by the authorization
31
+ # server.
32
+ UNSUPPORTED_GRANT_TYPE = 'unsupported_grant_type'.freeze,
33
+
34
+ # The requested scope is invalid, unknown, malformed, or exceeds the scope
35
+ # granted by the resource owner.
36
+ INVALID_SCOPE = 'invalid_scope'.freeze
37
+ ].freeze
38
+
39
+ def self.validate(value)
40
+ return false if value.nil?
41
+
42
+ OAUTH_PROVIDER_ERROR.include?(value)
43
+ end
44
+
45
+ def self.from_value(value, default_value = INVALID_REQUEST)
46
+ return default_value if value.nil?
47
+
48
+ str = value.to_s.strip
49
+
50
+ case str.downcase
51
+ when 'invalid_request' then INVALID_REQUEST
52
+ when 'invalid_client' then INVALID_CLIENT
53
+ when 'invalid_grant' then INVALID_GRANT
54
+ when 'unauthorized_client' then UNAUTHORIZED_CLIENT
55
+ when 'unsupported_grant_type' then UNSUPPORTED_GRANT_TYPE
56
+ when 'invalid_scope' then INVALID_SCOPE
57
+ else
58
+ default_value
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,26 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # OAuth 2 scopes supported by the API
8
+ class OauthScope
9
+ OAUTH_SCOPE = [
10
+ # Access to the Partner Reporting and Settlement APIs.
11
+ PARTNERS_REPORTING = 'partners_reporting'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ OAUTH_SCOPE.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = PARTNERS_REPORTING)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,96 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # OAuth 2 Authorization endpoint response
8
+ class OauthToken < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Access token
13
+ # @return [String]
14
+ attr_accessor :access_token
15
+
16
+ # Type of access token
17
+ # @return [String]
18
+ attr_accessor :token_type
19
+
20
+ # Time in seconds before the access token expires
21
+ # @return [Integer]
22
+ attr_accessor :expires_in
23
+
24
+ # List of scopes granted
25
+ # This is a space-delimited list of strings.
26
+ # @return [String]
27
+ attr_accessor :scope
28
+
29
+ # Time of token expiry as unix timestamp (UTC)
30
+ # @return [Integer]
31
+ attr_accessor :expiry
32
+
33
+ # Refresh token
34
+ # Used to get a new access token when it expires.
35
+ # @return [String]
36
+ attr_accessor :refresh_token
37
+
38
+ # A mapping from model property names to API property names.
39
+ def self.names
40
+ @_hash = {} if @_hash.nil?
41
+ @_hash['access_token'] = 'access_token'
42
+ @_hash['token_type'] = 'token_type'
43
+ @_hash['expires_in'] = 'expires_in'
44
+ @_hash['scope'] = 'scope'
45
+ @_hash['expiry'] = 'expiry'
46
+ @_hash['refresh_token'] = 'refresh_token'
47
+ @_hash
48
+ end
49
+
50
+ # An array for optional fields
51
+ def self.optionals
52
+ %w[
53
+ expires_in
54
+ scope
55
+ expiry
56
+ refresh_token
57
+ ]
58
+ end
59
+
60
+ # An array for nullable fields
61
+ def self.nullables
62
+ []
63
+ end
64
+
65
+ def initialize(access_token:, token_type:, expires_in: SKIP, scope: SKIP,
66
+ expiry: SKIP, refresh_token: SKIP)
67
+ @access_token = access_token
68
+ @token_type = token_type
69
+ @expires_in = expires_in unless expires_in == SKIP
70
+ @scope = scope unless scope == SKIP
71
+ @expiry = expiry unless expiry == SKIP
72
+ @refresh_token = refresh_token unless refresh_token == SKIP
73
+ end
74
+
75
+ # Creates an instance of the object from a hash.
76
+ def self.from_hash(hash)
77
+ return nil unless hash
78
+
79
+ # Extract variables from the hash.
80
+ access_token = hash.key?('access_token') ? hash['access_token'] : nil
81
+ token_type = hash.key?('token_type') ? hash['token_type'] : nil
82
+ expires_in = hash.key?('expires_in') ? hash['expires_in'] : SKIP
83
+ scope = hash.key?('scope') ? hash['scope'] : SKIP
84
+ expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
85
+ refresh_token = hash.key?('refresh_token') ? hash['refresh_token'] : SKIP
86
+
87
+ # Create object from extracted values.
88
+ OauthToken.new(access_token: access_token,
89
+ token_type: token_type,
90
+ expires_in: expires_in,
91
+ scope: scope,
92
+ expiry: expiry,
93
+ refresh_token: refresh_token)
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,48 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # Confirmation of the operation performed.
8
+ class Operation
9
+ OPERATION = [
10
+ # TODO: Write general description for ADVICE
11
+ ADVICE = 'advice'.freeze,
12
+
13
+ # TODO: Write general description for REVERSAL
14
+ REVERSAL = 'reversal'.freeze,
15
+
16
+ # TODO: Write general description for ADJUSTMENT
17
+ ADJUSTMENT = 'adjustment'.freeze,
18
+
19
+ # TODO: Write general description for REQUEST
20
+ REQUEST = 'request'.freeze,
21
+
22
+ # TODO: Write general description for PARTADVICE
23
+ PARTADVICE = 'part-advice'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ OPERATION.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = ADVICE)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'advice' then ADVICE
39
+ when 'reversal' then REVERSAL
40
+ when 'adjustment' then ADJUSTMENT
41
+ when 'request' then REQUEST
42
+ when 'partadvice' then PARTADVICE
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end