worldpay-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 (75) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +147 -0
  4. data/bin/console +15 -0
  5. data/lib/reporting_authorization_summary_api/api_helper.rb +10 -0
  6. data/lib/reporting_authorization_summary_api/apis/authorizations_api.rb +258 -0
  7. data/lib/reporting_authorization_summary_api/apis/base_api.rb +67 -0
  8. data/lib/reporting_authorization_summary_api/client.rb +75 -0
  9. data/lib/reporting_authorization_summary_api/configuration.rb +165 -0
  10. data/lib/reporting_authorization_summary_api/exceptions/api_exception.rb +21 -0
  11. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary0_error_exception.rb +55 -0
  12. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_cardnetwork0_error_exception.rb +55 -0
  13. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_chain0_error_exception.rb +55 -0
  14. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_division0_error_exception.rb +55 -0
  15. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_merchant0_error_exception.rb +55 -0
  16. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_store0_error_exception.rb +55 -0
  17. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_superchain0_error_exception.rb +55 -0
  18. data/lib/reporting_authorization_summary_api/exceptions/authorizations_summary_transactiondate0_error_exception.rb +55 -0
  19. data/lib/reporting_authorization_summary_api/http/api_response.rb +19 -0
  20. data/lib/reporting_authorization_summary_api/http/auth/custom_header_authentication.rb +52 -0
  21. data/lib/reporting_authorization_summary_api/http/http_call_back.rb +10 -0
  22. data/lib/reporting_authorization_summary_api/http/http_method_enum.rb +10 -0
  23. data/lib/reporting_authorization_summary_api/http/http_request.rb +10 -0
  24. data/lib/reporting_authorization_summary_api/http/http_response.rb +10 -0
  25. data/lib/reporting_authorization_summary_api/http/proxy_settings.rb +22 -0
  26. data/lib/reporting_authorization_summary_api/logging/configuration/api_logging_configuration.rb +186 -0
  27. data/lib/reporting_authorization_summary_api/logging/sdk_logger.rb +17 -0
  28. data/lib/reporting_authorization_summary_api/models/auth_transactions_request.rb +107 -0
  29. data/lib/reporting_authorization_summary_api/models/auth_transactions_request_by_chain.rb +116 -0
  30. data/lib/reporting_authorization_summary_api/models/auth_transactions_request_by_division.rb +116 -0
  31. data/lib/reporting_authorization_summary_api/models/auth_transactions_request_by_store.rb +116 -0
  32. data/lib/reporting_authorization_summary_api/models/auth_transactions_request_by_super_chain.rb +116 -0
  33. data/lib/reporting_authorization_summary_api/models/auth_transactions_summary_request_by_card_network.rb +116 -0
  34. data/lib/reporting_authorization_summary_api/models/auth_transactions_summary_request_by_merchant.rb +116 -0
  35. data/lib/reporting_authorization_summary_api/models/auth_transactions_summary_request_by_transaction_date.rb +116 -0
  36. data/lib/reporting_authorization_summary_api/models/authorizations_summary_cardnetwork_response.rb +233 -0
  37. data/lib/reporting_authorization_summary_api/models/authorizations_summary_transactiondate_response.rb +233 -0
  38. data/lib/reporting_authorization_summary_api/models/base_model.rb +110 -0
  39. data/lib/reporting_authorization_summary_api/models/card_network_type.rb +68 -0
  40. data/lib/reporting_authorization_summary_api/models/code_and_description.rb +98 -0
  41. data/lib/reporting_authorization_summary_api/models/common_summary_detail.rb +161 -0
  42. data/lib/reporting_authorization_summary_api/models/common_summary_responses.rb +213 -0
  43. data/lib/reporting_authorization_summary_api/models/date_range.rb +82 -0
  44. data/lib/reporting_authorization_summary_api/models/date_range_type.rb +85 -0
  45. data/lib/reporting_authorization_summary_api/models/entity.rb +99 -0
  46. data/lib/reporting_authorization_summary_api/models/entity_division_response.rb +94 -0
  47. data/lib/reporting_authorization_summary_api/models/entity_store_response.rb +95 -0
  48. data/lib/reporting_authorization_summary_api/models/error.rb +96 -0
  49. data/lib/reporting_authorization_summary_api/models/error_response.rb +84 -0
  50. data/lib/reporting_authorization_summary_api/models/level.rb +67 -0
  51. data/lib/reporting_authorization_summary_api/models/pagination.rb +87 -0
  52. data/lib/reporting_authorization_summary_api/models/pagination_response.rb +108 -0
  53. data/lib/reporting_authorization_summary_api/models/pagination_type.rb +87 -0
  54. data/lib/reporting_authorization_summary_api/models/summary.rb +183 -0
  55. data/lib/reporting_authorization_summary_api/models/summary1.rb +173 -0
  56. data/lib/reporting_authorization_summary_api/models/summary2.rb +190 -0
  57. data/lib/reporting_authorization_summary_api/models/summary3.rb +189 -0
  58. data/lib/reporting_authorization_summary_api/models/summary4.rb +174 -0
  59. data/lib/reporting_authorization_summary_api/models/summary5.rb +174 -0
  60. data/lib/reporting_authorization_summary_api/models/summary6.rb +173 -0
  61. data/lib/reporting_authorization_summary_api/models/summary_card_network.rb +233 -0
  62. data/lib/reporting_authorization_summary_api/models/summary_detail_chain.rb +233 -0
  63. data/lib/reporting_authorization_summary_api/models/summary_detail_division.rb +233 -0
  64. data/lib/reporting_authorization_summary_api/models/summary_detail_entity_chain.rb +79 -0
  65. data/lib/reporting_authorization_summary_api/models/summary_detail_entity_entity.rb +79 -0
  66. data/lib/reporting_authorization_summary_api/models/summary_detail_entity_super_chain.rb +78 -0
  67. data/lib/reporting_authorization_summary_api/models/summary_detail_merchant.rb +233 -0
  68. data/lib/reporting_authorization_summary_api/models/summary_detail_store.rb +233 -0
  69. data/lib/reporting_authorization_summary_api/models/summary_detail_super_chain.rb +233 -0
  70. data/lib/reporting_authorization_summary_api/models/summary_responses.rb +202 -0
  71. data/lib/reporting_authorization_summary_api/models/summary_transaction_date.rb +233 -0
  72. data/lib/reporting_authorization_summary_api/utilities/date_time_helper.rb +11 -0
  73. data/lib/reporting_authorization_summary_api/utilities/file_wrapper.rb +28 -0
  74. data/lib/reporting_authorization_summary_api.rb +132 -0
  75. metadata +158 -0
@@ -0,0 +1,233 @@
1
+ # reporting_authorization_summary_api
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module ReportingAuthorizationSummaryApi
7
+ # AuthorizationsSummaryCardnetworkResponse Model.
8
+ class AuthorizationsSummaryCardnetworkResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [PaginationResponse]
14
+ attr_accessor :pagination
15
+
16
+ # Count of the approved transactions.
17
+ # @return [Integer]
18
+ attr_accessor :total_approved_count
19
+
20
+ # Sum of the amount of approved transactions.
21
+ # @return [Float]
22
+ attr_accessor :total_approved_amount
23
+
24
+ # Count of the declined transactions.
25
+ # @return [Integer]
26
+ attr_accessor :total_declined_count
27
+
28
+ # Sum of the amount of declined transactions.
29
+ # @return [Float]
30
+ attr_accessor :total_declined_amount
31
+
32
+ # Ratio of the count of approved transactions to the count of total
33
+ # transctions.
34
+ # @return [Float]
35
+ attr_accessor :total_approved_count_percent
36
+
37
+ # Ratio of the sum of the amount of the approved transactions to the sum of
38
+ # amount of total transctions.
39
+ # @return [Float]
40
+ attr_accessor :total_approved_amount_percent
41
+
42
+ # Ratio of the count of the declined transactions to the count of total
43
+ # transctions.
44
+ # @return [Float]
45
+ attr_accessor :total_declined_count_percent
46
+
47
+ # Ratio of the sum of the amount of the declined transactions to the sum of
48
+ # the amount of total transctions.
49
+ # @return [Float]
50
+ attr_accessor :total_declined_amount_percent
51
+
52
+ # Sum of the count of the approved transactions and the count of the
53
+ # declined transactions.
54
+ # @return [Integer]
55
+ attr_accessor :total_count
56
+
57
+ # Sum of the amount of approved transactions and the amount of the declined
58
+ # transactions.
59
+ # @return [Float]
60
+ attr_accessor :total_amount
61
+
62
+ # Summary
63
+ # @return [Array[Summary]]
64
+ attr_accessor :summaries
65
+
66
+ # A mapping from model property names to API property names.
67
+ def self.names
68
+ @_hash = {} if @_hash.nil?
69
+ @_hash['pagination'] = 'pagination'
70
+ @_hash['total_approved_count'] = 'totalApprovedCount'
71
+ @_hash['total_approved_amount'] = 'totalApprovedAmount'
72
+ @_hash['total_declined_count'] = 'totalDeclinedCount'
73
+ @_hash['total_declined_amount'] = 'totalDeclinedAmount'
74
+ @_hash['total_approved_count_percent'] = 'totalApprovedCountPercent'
75
+ @_hash['total_approved_amount_percent'] = 'totalApprovedAmountPercent'
76
+ @_hash['total_declined_count_percent'] = 'totalDeclinedCountPercent'
77
+ @_hash['total_declined_amount_percent'] = 'totalDeclinedAmountPercent'
78
+ @_hash['total_count'] = 'totalCount'
79
+ @_hash['total_amount'] = 'totalAmount'
80
+ @_hash['summaries'] = 'summaries'
81
+ @_hash
82
+ end
83
+
84
+ # An array for optional fields
85
+ def self.optionals
86
+ %w[
87
+ pagination
88
+ total_approved_count
89
+ total_approved_amount
90
+ total_declined_count
91
+ total_declined_amount
92
+ total_approved_count_percent
93
+ total_approved_amount_percent
94
+ total_declined_count_percent
95
+ total_declined_amount_percent
96
+ total_count
97
+ total_amount
98
+ summaries
99
+ ]
100
+ end
101
+
102
+ # An array for nullable fields
103
+ def self.nullables
104
+ []
105
+ end
106
+
107
+ def initialize(pagination: SKIP, total_approved_count: SKIP,
108
+ total_approved_amount: SKIP, total_declined_count: SKIP,
109
+ total_declined_amount: SKIP,
110
+ total_approved_count_percent: SKIP,
111
+ total_approved_amount_percent: SKIP,
112
+ total_declined_count_percent: SKIP,
113
+ total_declined_amount_percent: SKIP, total_count: SKIP,
114
+ total_amount: SKIP, summaries: SKIP,
115
+ additional_properties: nil)
116
+ # Add additional model properties to the instance
117
+ additional_properties = {} if additional_properties.nil?
118
+
119
+ @pagination = pagination unless pagination == SKIP
120
+ @total_approved_count = total_approved_count unless total_approved_count == SKIP
121
+ @total_approved_amount = total_approved_amount unless total_approved_amount == SKIP
122
+ @total_declined_count = total_declined_count unless total_declined_count == SKIP
123
+ @total_declined_amount = total_declined_amount unless total_declined_amount == SKIP
124
+ unless total_approved_count_percent == SKIP
125
+ @total_approved_count_percent =
126
+ total_approved_count_percent
127
+ end
128
+ unless total_approved_amount_percent == SKIP
129
+ @total_approved_amount_percent =
130
+ total_approved_amount_percent
131
+ end
132
+ unless total_declined_count_percent == SKIP
133
+ @total_declined_count_percent =
134
+ total_declined_count_percent
135
+ end
136
+ unless total_declined_amount_percent == SKIP
137
+ @total_declined_amount_percent =
138
+ total_declined_amount_percent
139
+ end
140
+ @total_count = total_count unless total_count == SKIP
141
+ @total_amount = total_amount unless total_amount == SKIP
142
+ @summaries = summaries unless summaries == SKIP
143
+ @additional_properties = additional_properties
144
+ end
145
+
146
+ # Creates an instance of the object from a hash.
147
+ def self.from_hash(hash)
148
+ return nil unless hash
149
+
150
+ # Extract variables from the hash.
151
+ pagination = PaginationResponse.from_hash(hash['pagination']) if hash['pagination']
152
+ total_approved_count =
153
+ hash.key?('totalApprovedCount') ? hash['totalApprovedCount'] : SKIP
154
+ total_approved_amount =
155
+ hash.key?('totalApprovedAmount') ? hash['totalApprovedAmount'] : SKIP
156
+ total_declined_count =
157
+ hash.key?('totalDeclinedCount') ? hash['totalDeclinedCount'] : SKIP
158
+ total_declined_amount =
159
+ hash.key?('totalDeclinedAmount') ? hash['totalDeclinedAmount'] : SKIP
160
+ total_approved_count_percent =
161
+ hash.key?('totalApprovedCountPercent') ? hash['totalApprovedCountPercent'] : SKIP
162
+ total_approved_amount_percent =
163
+ hash.key?('totalApprovedAmountPercent') ? hash['totalApprovedAmountPercent'] : SKIP
164
+ total_declined_count_percent =
165
+ hash.key?('totalDeclinedCountPercent') ? hash['totalDeclinedCountPercent'] : SKIP
166
+ total_declined_amount_percent =
167
+ hash.key?('totalDeclinedAmountPercent') ? hash['totalDeclinedAmountPercent'] : SKIP
168
+ total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
169
+ total_amount = hash.key?('totalAmount') ? hash['totalAmount'] : SKIP
170
+ # Parameter is an array, so we need to iterate through it
171
+ summaries = nil
172
+ unless hash['summaries'].nil?
173
+ summaries = []
174
+ hash['summaries'].each do |structure|
175
+ summaries << (Summary.from_hash(structure) if structure)
176
+ end
177
+ end
178
+
179
+ summaries = SKIP unless hash.key?('summaries')
180
+
181
+ # Create a new hash for additional properties, removing known properties.
182
+ new_hash = hash.reject { |k, _| names.value?(k) }
183
+
184
+ additional_properties = APIHelper.get_additional_properties(
185
+ new_hash, proc { |value| value }
186
+ )
187
+
188
+ # Create object from extracted values.
189
+ AuthorizationsSummaryCardnetworkResponse.new(pagination: pagination,
190
+ total_approved_count: total_approved_count,
191
+ total_approved_amount: total_approved_amount,
192
+ total_declined_count: total_declined_count,
193
+ total_declined_amount: total_declined_amount,
194
+ total_approved_count_percent: total_approved_count_percent,
195
+ total_approved_amount_percent: total_approved_amount_percent,
196
+ total_declined_count_percent: total_declined_count_percent,
197
+ total_declined_amount_percent: total_declined_amount_percent,
198
+ total_count: total_count,
199
+ total_amount: total_amount,
200
+ summaries: summaries,
201
+ additional_properties: additional_properties)
202
+ end
203
+
204
+ # Provides a human-readable string representation of the object.
205
+ def to_s
206
+ class_name = self.class.name.split('::').last
207
+ "<#{class_name} pagination: #{@pagination}, total_approved_count: #{@total_approved_count},"\
208
+ " total_approved_amount: #{@total_approved_amount}, total_declined_count:"\
209
+ " #{@total_declined_count}, total_declined_amount: #{@total_declined_amount},"\
210
+ " total_approved_count_percent: #{@total_approved_count_percent},"\
211
+ " total_approved_amount_percent: #{@total_approved_amount_percent},"\
212
+ " total_declined_count_percent: #{@total_declined_count_percent},"\
213
+ " total_declined_amount_percent: #{@total_declined_amount_percent}, total_count:"\
214
+ " #{@total_count}, total_amount: #{@total_amount}, summaries: #{@summaries},"\
215
+ " additional_properties: #{@additional_properties}>"
216
+ end
217
+
218
+ # Provides a debugging-friendly string with detailed object information.
219
+ def inspect
220
+ class_name = self.class.name.split('::').last
221
+ "<#{class_name} pagination: #{@pagination.inspect}, total_approved_count:"\
222
+ " #{@total_approved_count.inspect}, total_approved_amount:"\
223
+ " #{@total_approved_amount.inspect}, total_declined_count: #{@total_declined_count.inspect},"\
224
+ " total_declined_amount: #{@total_declined_amount.inspect}, total_approved_count_percent:"\
225
+ " #{@total_approved_count_percent.inspect}, total_approved_amount_percent:"\
226
+ " #{@total_approved_amount_percent.inspect}, total_declined_count_percent:"\
227
+ " #{@total_declined_count_percent.inspect}, total_declined_amount_percent:"\
228
+ " #{@total_declined_amount_percent.inspect}, total_count: #{@total_count.inspect},"\
229
+ " total_amount: #{@total_amount.inspect}, summaries: #{@summaries.inspect},"\
230
+ " additional_properties: #{@additional_properties}>"
231
+ end
232
+ end
233
+ end
@@ -0,0 +1,233 @@
1
+ # reporting_authorization_summary_api
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module ReportingAuthorizationSummaryApi
7
+ # AuthorizationsSummaryTransactiondateResponse Model.
8
+ class AuthorizationsSummaryTransactiondateResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [PaginationResponse]
14
+ attr_accessor :pagination
15
+
16
+ # Count of the approved transactions.
17
+ # @return [Integer]
18
+ attr_accessor :total_approved_count
19
+
20
+ # Sum of the amount of approved transactions.
21
+ # @return [Float]
22
+ attr_accessor :total_approved_amount
23
+
24
+ # Count of the declined transactions.
25
+ # @return [Integer]
26
+ attr_accessor :total_declined_count
27
+
28
+ # Sum of the amount of declined transactions.
29
+ # @return [Float]
30
+ attr_accessor :total_declined_amount
31
+
32
+ # Ratio of the count of approved transactions to the count of total
33
+ # transctions.
34
+ # @return [Float]
35
+ attr_accessor :total_approved_count_percent
36
+
37
+ # Ratio of the sum of the amount of the approved transactions to the sum of
38
+ # amount of total transctions.
39
+ # @return [Float]
40
+ attr_accessor :total_approved_amount_percent
41
+
42
+ # Ratio of the count of the declined transactions to the count of total
43
+ # transctions.
44
+ # @return [Float]
45
+ attr_accessor :total_declined_count_percent
46
+
47
+ # Ratio of the sum of the amount of the declined transactions to the sum of
48
+ # the amount of total transctions.
49
+ # @return [Float]
50
+ attr_accessor :total_declined_amount_percent
51
+
52
+ # Sum of the count of the approved transactions and the count of the
53
+ # declined transactions.
54
+ # @return [Integer]
55
+ attr_accessor :total_count
56
+
57
+ # Sum of the amount of approved transactions and the amount of the declined
58
+ # transactions.
59
+ # @return [Float]
60
+ attr_accessor :total_amount
61
+
62
+ # Capturing the fields.
63
+ # @return [Array[Summary1]]
64
+ attr_accessor :summaries
65
+
66
+ # A mapping from model property names to API property names.
67
+ def self.names
68
+ @_hash = {} if @_hash.nil?
69
+ @_hash['pagination'] = 'pagination'
70
+ @_hash['total_approved_count'] = 'totalApprovedCount'
71
+ @_hash['total_approved_amount'] = 'totalApprovedAmount'
72
+ @_hash['total_declined_count'] = 'totalDeclinedCount'
73
+ @_hash['total_declined_amount'] = 'totalDeclinedAmount'
74
+ @_hash['total_approved_count_percent'] = 'totalApprovedCountPercent'
75
+ @_hash['total_approved_amount_percent'] = 'totalApprovedAmountPercent'
76
+ @_hash['total_declined_count_percent'] = 'totalDeclinedCountPercent'
77
+ @_hash['total_declined_amount_percent'] = 'totalDeclinedAmountPercent'
78
+ @_hash['total_count'] = 'totalCount'
79
+ @_hash['total_amount'] = 'totalAmount'
80
+ @_hash['summaries'] = 'summaries'
81
+ @_hash
82
+ end
83
+
84
+ # An array for optional fields
85
+ def self.optionals
86
+ %w[
87
+ pagination
88
+ total_approved_count
89
+ total_approved_amount
90
+ total_declined_count
91
+ total_declined_amount
92
+ total_approved_count_percent
93
+ total_approved_amount_percent
94
+ total_declined_count_percent
95
+ total_declined_amount_percent
96
+ total_count
97
+ total_amount
98
+ summaries
99
+ ]
100
+ end
101
+
102
+ # An array for nullable fields
103
+ def self.nullables
104
+ []
105
+ end
106
+
107
+ def initialize(pagination: SKIP, total_approved_count: SKIP,
108
+ total_approved_amount: SKIP, total_declined_count: SKIP,
109
+ total_declined_amount: SKIP,
110
+ total_approved_count_percent: SKIP,
111
+ total_approved_amount_percent: SKIP,
112
+ total_declined_count_percent: SKIP,
113
+ total_declined_amount_percent: SKIP, total_count: SKIP,
114
+ total_amount: SKIP, summaries: SKIP,
115
+ additional_properties: nil)
116
+ # Add additional model properties to the instance
117
+ additional_properties = {} if additional_properties.nil?
118
+
119
+ @pagination = pagination unless pagination == SKIP
120
+ @total_approved_count = total_approved_count unless total_approved_count == SKIP
121
+ @total_approved_amount = total_approved_amount unless total_approved_amount == SKIP
122
+ @total_declined_count = total_declined_count unless total_declined_count == SKIP
123
+ @total_declined_amount = total_declined_amount unless total_declined_amount == SKIP
124
+ unless total_approved_count_percent == SKIP
125
+ @total_approved_count_percent =
126
+ total_approved_count_percent
127
+ end
128
+ unless total_approved_amount_percent == SKIP
129
+ @total_approved_amount_percent =
130
+ total_approved_amount_percent
131
+ end
132
+ unless total_declined_count_percent == SKIP
133
+ @total_declined_count_percent =
134
+ total_declined_count_percent
135
+ end
136
+ unless total_declined_amount_percent == SKIP
137
+ @total_declined_amount_percent =
138
+ total_declined_amount_percent
139
+ end
140
+ @total_count = total_count unless total_count == SKIP
141
+ @total_amount = total_amount unless total_amount == SKIP
142
+ @summaries = summaries unless summaries == SKIP
143
+ @additional_properties = additional_properties
144
+ end
145
+
146
+ # Creates an instance of the object from a hash.
147
+ def self.from_hash(hash)
148
+ return nil unless hash
149
+
150
+ # Extract variables from the hash.
151
+ pagination = PaginationResponse.from_hash(hash['pagination']) if hash['pagination']
152
+ total_approved_count =
153
+ hash.key?('totalApprovedCount') ? hash['totalApprovedCount'] : SKIP
154
+ total_approved_amount =
155
+ hash.key?('totalApprovedAmount') ? hash['totalApprovedAmount'] : SKIP
156
+ total_declined_count =
157
+ hash.key?('totalDeclinedCount') ? hash['totalDeclinedCount'] : SKIP
158
+ total_declined_amount =
159
+ hash.key?('totalDeclinedAmount') ? hash['totalDeclinedAmount'] : SKIP
160
+ total_approved_count_percent =
161
+ hash.key?('totalApprovedCountPercent') ? hash['totalApprovedCountPercent'] : SKIP
162
+ total_approved_amount_percent =
163
+ hash.key?('totalApprovedAmountPercent') ? hash['totalApprovedAmountPercent'] : SKIP
164
+ total_declined_count_percent =
165
+ hash.key?('totalDeclinedCountPercent') ? hash['totalDeclinedCountPercent'] : SKIP
166
+ total_declined_amount_percent =
167
+ hash.key?('totalDeclinedAmountPercent') ? hash['totalDeclinedAmountPercent'] : SKIP
168
+ total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
169
+ total_amount = hash.key?('totalAmount') ? hash['totalAmount'] : SKIP
170
+ # Parameter is an array, so we need to iterate through it
171
+ summaries = nil
172
+ unless hash['summaries'].nil?
173
+ summaries = []
174
+ hash['summaries'].each do |structure|
175
+ summaries << (Summary1.from_hash(structure) if structure)
176
+ end
177
+ end
178
+
179
+ summaries = SKIP unless hash.key?('summaries')
180
+
181
+ # Create a new hash for additional properties, removing known properties.
182
+ new_hash = hash.reject { |k, _| names.value?(k) }
183
+
184
+ additional_properties = APIHelper.get_additional_properties(
185
+ new_hash, proc { |value| value }
186
+ )
187
+
188
+ # Create object from extracted values.
189
+ AuthorizationsSummaryTransactiondateResponse.new(pagination: pagination,
190
+ total_approved_count: total_approved_count,
191
+ total_approved_amount: total_approved_amount,
192
+ total_declined_count: total_declined_count,
193
+ total_declined_amount: total_declined_amount,
194
+ total_approved_count_percent: total_approved_count_percent,
195
+ total_approved_amount_percent: total_approved_amount_percent,
196
+ total_declined_count_percent: total_declined_count_percent,
197
+ total_declined_amount_percent: total_declined_amount_percent,
198
+ total_count: total_count,
199
+ total_amount: total_amount,
200
+ summaries: summaries,
201
+ additional_properties: additional_properties)
202
+ end
203
+
204
+ # Provides a human-readable string representation of the object.
205
+ def to_s
206
+ class_name = self.class.name.split('::').last
207
+ "<#{class_name} pagination: #{@pagination}, total_approved_count: #{@total_approved_count},"\
208
+ " total_approved_amount: #{@total_approved_amount}, total_declined_count:"\
209
+ " #{@total_declined_count}, total_declined_amount: #{@total_declined_amount},"\
210
+ " total_approved_count_percent: #{@total_approved_count_percent},"\
211
+ " total_approved_amount_percent: #{@total_approved_amount_percent},"\
212
+ " total_declined_count_percent: #{@total_declined_count_percent},"\
213
+ " total_declined_amount_percent: #{@total_declined_amount_percent}, total_count:"\
214
+ " #{@total_count}, total_amount: #{@total_amount}, summaries: #{@summaries},"\
215
+ " additional_properties: #{@additional_properties}>"
216
+ end
217
+
218
+ # Provides a debugging-friendly string with detailed object information.
219
+ def inspect
220
+ class_name = self.class.name.split('::').last
221
+ "<#{class_name} pagination: #{@pagination.inspect}, total_approved_count:"\
222
+ " #{@total_approved_count.inspect}, total_approved_amount:"\
223
+ " #{@total_approved_amount.inspect}, total_declined_count: #{@total_declined_count.inspect},"\
224
+ " total_declined_amount: #{@total_declined_amount.inspect}, total_approved_count_percent:"\
225
+ " #{@total_approved_count_percent.inspect}, total_approved_amount_percent:"\
226
+ " #{@total_approved_amount_percent.inspect}, total_declined_count_percent:"\
227
+ " #{@total_declined_count_percent.inspect}, total_declined_amount_percent:"\
228
+ " #{@total_declined_amount_percent.inspect}, total_count: #{@total_count.inspect},"\
229
+ " total_amount: #{@total_amount.inspect}, summaries: #{@summaries.inspect},"\
230
+ " additional_properties: #{@additional_properties}>"
231
+ end
232
+ end
233
+ end
@@ -0,0 +1,110 @@
1
+ # reporting_authorization_summary_api
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module ReportingAuthorizationSummaryApi
7
+ # Base model.
8
+ # rubocop:disable all
9
+ class BaseModel < CoreLibrary::BaseModel
10
+ # Returns a Hash representation of the current object.
11
+ def to_hash
12
+ # validating the model being serialized
13
+ self.class.validate(self) if self.class.respond_to?(:validate)
14
+
15
+ hash = {}
16
+ instance_variables.each do |name|
17
+ value = instance_variable_get(name)
18
+ name = name[1..]
19
+ if name == 'additional_properties'
20
+ additional_properties = process_additional_properties(value, self.class.names)
21
+ hash.merge!(additional_properties)
22
+ else
23
+ key = self.class.names.key?(name) ? self.class.names[name] : name
24
+ optional_fields = self.class.optionals
25
+ nullable_fields = self.class.nullables
26
+ if value.nil?
27
+ next unless nullable_fields.include?(name)
28
+
29
+ if !optional_fields.include?(name) && !nullable_fields.include?(name)
30
+ raise ArgumentError,
31
+ "`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
32
+ end
33
+ end
34
+
35
+ hash[key] = nil
36
+ unless value.nil?
37
+ if respond_to?("to_custom_#{name}")
38
+ if (value.instance_of? Array) || (value.instance_of? Hash)
39
+ params = [hash, key]
40
+ hash[key] = send("to_custom_#{name}", *params)
41
+ else
42
+ hash[key] = send("to_custom_#{name}")
43
+ end
44
+ elsif respond_to?("to_union_type_#{name}")
45
+ hash[key] = send("to_union_type_#{name}")
46
+ elsif value.instance_of? Array
47
+ hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
48
+ elsif value.instance_of? Hash
49
+ hash[key] = {}
50
+ value.each do |k, v|
51
+ hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
52
+ end
53
+ else
54
+ hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
55
+ end
56
+ end
57
+ end
58
+ end
59
+ hash
60
+ end
61
+
62
+ # Processes additional properties, ensuring no conflicts with existing properties.
63
+ def process_additional_properties(additional_properties, existing_prop_names)
64
+ hash = {}
65
+ additional_properties.each do |name, value|
66
+ check_for_conflict(name, existing_prop_names)
67
+
68
+ hash[name] = if value.is_a?(Array)
69
+ process_array(value)
70
+ elsif value.is_a?(Hash)
71
+ process_hash(value)
72
+ else
73
+ process_basic_value(value)
74
+ end
75
+ end
76
+ hash
77
+ end
78
+
79
+ # Checks if an additional property conflicts with a model's existing property.
80
+ def check_for_conflict(name, existing_prop_names)
81
+ return unless existing_prop_names.key?(name)
82
+
83
+ raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
84
+ end
85
+
86
+ # Processes an array of values, recursively calling `to_hash` on BaseModel objects.
87
+ def process_array(value)
88
+ value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
89
+ end
90
+
91
+ # Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
92
+ def process_hash(value)
93
+ value.transform_values do |v|
94
+ v.is_a?(BaseModel) ? v.to_hash : v
95
+ end
96
+ end
97
+
98
+ # Processes a basic value (non-array, non-hash).
99
+ def process_basic_value(value)
100
+ value.is_a?(BaseModel) ? value.to_hash : value
101
+ end
102
+
103
+ # Returns a JSON representation of the curent object.
104
+ def to_json(options = {})
105
+ hash = to_hash
106
+ hash.to_json(options)
107
+ end
108
+ end
109
+ # rubocop:enable all
110
+ end
@@ -0,0 +1,68 @@
1
+ # reporting_authorization_summary_api
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module ReportingAuthorizationSummaryApi
7
+ # CardNetworkType.
8
+ class CardNetworkType
9
+ CARD_NETWORK_TYPE = [
10
+ # TODO: Write general description for BILL_ME_LATER
11
+ BILL_ME_LATER = 'BILL_ME_LATER'.freeze,
12
+
13
+ # TODO: Write general description for VISA
14
+ VISA = 'VISA'.freeze,
15
+
16
+ # TODO: Write general description for MASTERCARD
17
+ MASTERCARD = 'MASTERCARD'.freeze,
18
+
19
+ # TODO: Write general description for DISCOVER
20
+ DISCOVER = 'DISCOVER'.freeze,
21
+
22
+ # TODO: Write general description for AMEX
23
+ AMEX = 'AMEX'.freeze,
24
+
25
+ # TODO: Write general description for DINERS
26
+ DINERS = 'DINERS'.freeze,
27
+
28
+ # TODO: Write general description for WRIGHT_EXPRESS
29
+ WRIGHT_EXPRESS = 'WRIGHT_EXPRESS'.freeze,
30
+
31
+ # TODO: Write general description for VOYAGER
32
+ VOYAGER = 'VOYAGER'.freeze,
33
+
34
+ # TODO: Write general description for PRIVATE_LABEL
35
+ PRIVATE_LABEL = 'PRIVATE_LABEL'.freeze,
36
+
37
+ # TODO: Write general description for JCB
38
+ JCB = 'JCB'.freeze
39
+ ].freeze
40
+
41
+ def self.validate(value)
42
+ return false if value.nil?
43
+
44
+ CARD_NETWORK_TYPE.include?(value)
45
+ end
46
+
47
+ def self.from_value(value, default_value = BILL_ME_LATER)
48
+ return default_value if value.nil?
49
+
50
+ str = value.to_s.strip
51
+
52
+ case str.downcase
53
+ when 'bill_me_later' then BILL_ME_LATER
54
+ when 'visa' then VISA
55
+ when 'mastercard' then MASTERCARD
56
+ when 'discover' then DISCOVER
57
+ when 'amex' then AMEX
58
+ when 'diners' then DINERS
59
+ when 'wright_express' then WRIGHT_EXPRESS
60
+ when 'voyager' then VOYAGER
61
+ when 'private_label' then PRIVATE_LABEL
62
+ when 'jcb' then JCB
63
+ else
64
+ default_value
65
+ end
66
+ end
67
+ end
68
+ end