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,108 @@
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
+ # PaginationResponse Model.
8
+ class PaginationResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The number of the specific page you want to retrieve.
13
+ # @return [Integer]
14
+ attr_accessor :page_number
15
+
16
+ # The number of records that you would want to retrieve per page.
17
+ # @return [Integer]
18
+ attr_accessor :page_size
19
+
20
+ # The total number of result rows returned.
21
+ # @return [Integer]
22
+ attr_accessor :total_row_count
23
+
24
+ # The total number of records returned.
25
+ # @return [Integer]
26
+ attr_accessor :total_returned_count
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['page_number'] = 'pageNumber'
32
+ @_hash['page_size'] = 'pageSize'
33
+ @_hash['total_row_count'] = 'totalRowCount'
34
+ @_hash['total_returned_count'] = 'totalReturnedCount'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ page_number
42
+ page_size
43
+ total_row_count
44
+ total_returned_count
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(page_number: SKIP, page_size: SKIP, total_row_count: SKIP,
54
+ total_returned_count: SKIP, additional_properties: nil)
55
+ # Add additional model properties to the instance
56
+ additional_properties = {} if additional_properties.nil?
57
+
58
+ @page_number = page_number unless page_number == SKIP
59
+ @page_size = page_size unless page_size == SKIP
60
+ @total_row_count = total_row_count unless total_row_count == SKIP
61
+ @total_returned_count = total_returned_count unless total_returned_count == SKIP
62
+ @additional_properties = additional_properties
63
+ end
64
+
65
+ # Creates an instance of the object from a hash.
66
+ def self.from_hash(hash)
67
+ return nil unless hash
68
+
69
+ # Extract variables from the hash.
70
+ page_number = hash.key?('pageNumber') ? hash['pageNumber'] : SKIP
71
+ page_size = hash.key?('pageSize') ? hash['pageSize'] : SKIP
72
+ total_row_count =
73
+ hash.key?('totalRowCount') ? hash['totalRowCount'] : SKIP
74
+ total_returned_count =
75
+ hash.key?('totalReturnedCount') ? hash['totalReturnedCount'] : SKIP
76
+
77
+ # Create a new hash for additional properties, removing known properties.
78
+ new_hash = hash.reject { |k, _| names.value?(k) }
79
+
80
+ additional_properties = APIHelper.get_additional_properties(
81
+ new_hash, proc { |value| value }
82
+ )
83
+
84
+ # Create object from extracted values.
85
+ PaginationResponse.new(page_number: page_number,
86
+ page_size: page_size,
87
+ total_row_count: total_row_count,
88
+ total_returned_count: total_returned_count,
89
+ additional_properties: additional_properties)
90
+ end
91
+
92
+ # Provides a human-readable string representation of the object.
93
+ def to_s
94
+ class_name = self.class.name.split('::').last
95
+ "<#{class_name} page_number: #{@page_number}, page_size: #{@page_size}, total_row_count:"\
96
+ " #{@total_row_count}, total_returned_count: #{@total_returned_count},"\
97
+ " additional_properties: #{@additional_properties}>"
98
+ end
99
+
100
+ # Provides a debugging-friendly string with detailed object information.
101
+ def inspect
102
+ class_name = self.class.name.split('::').last
103
+ "<#{class_name} page_number: #{@page_number.inspect}, page_size: #{@page_size.inspect},"\
104
+ " total_row_count: #{@total_row_count.inspect}, total_returned_count:"\
105
+ " #{@total_returned_count.inspect}, additional_properties: #{@additional_properties}>"
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,87 @@
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
+ # Retrieves the numbers or marks used to indicate the sequence of pages.
8
+ class PaginationType < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The number of the specific page you want to retrieve. <br>Default is page
13
+ # number 01.
14
+ # @return [Integer]
15
+ attr_accessor :page_number
16
+
17
+ # The number of records that you would want to retrieve per page.
18
+ # <br>Default is 25 items per page.
19
+ # @return [Integer]
20
+ attr_accessor :page_size
21
+
22
+ # A mapping from model property names to API property names.
23
+ def self.names
24
+ @_hash = {} if @_hash.nil?
25
+ @_hash['page_number'] = 'pageNumber'
26
+ @_hash['page_size'] = 'pageSize'
27
+ @_hash
28
+ end
29
+
30
+ # An array for optional fields
31
+ def self.optionals
32
+ %w[
33
+ page_number
34
+ page_size
35
+ ]
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(page_number: 1, page_size: 25, additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @page_number = page_number unless page_number == SKIP
48
+ @page_size = page_size unless page_size == SKIP
49
+ @additional_properties = additional_properties
50
+ end
51
+
52
+ # Creates an instance of the object from a hash.
53
+ def self.from_hash(hash)
54
+ return nil unless hash
55
+
56
+ # Extract variables from the hash.
57
+ page_number = hash['pageNumber'] ||= 1
58
+ page_size = hash['pageSize'] ||= 25
59
+
60
+ # Create a new hash for additional properties, removing known properties.
61
+ new_hash = hash.reject { |k, _| names.value?(k) }
62
+
63
+ additional_properties = APIHelper.get_additional_properties(
64
+ new_hash, proc { |value| value }
65
+ )
66
+
67
+ # Create object from extracted values.
68
+ PaginationType.new(page_number: page_number,
69
+ page_size: page_size,
70
+ additional_properties: additional_properties)
71
+ end
72
+
73
+ # Provides a human-readable string representation of the object.
74
+ def to_s
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} page_number: #{@page_number}, page_size: #{@page_size},"\
77
+ " additional_properties: #{@additional_properties}>"
78
+ end
79
+
80
+ # Provides a debugging-friendly string with detailed object information.
81
+ def inspect
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} page_number: #{@page_number.inspect}, page_size: #{@page_size.inspect},"\
84
+ " additional_properties: #{@additional_properties}>"
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,183 @@
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
+ # Summary Model.
8
+ class Summary < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Count of the approved transactions.
13
+ # @return [Integer]
14
+ attr_accessor :approved_count
15
+
16
+ # Sum of the amount of approved transactions.
17
+ # @return [Float]
18
+ attr_accessor :approved_amount
19
+
20
+ # Count of the declined transactions.
21
+ # @return [Integer]
22
+ attr_accessor :declined_count
23
+
24
+ # Sum of the amount of the declined transactions.
25
+ # @return [Float]
26
+ attr_accessor :declined_amount
27
+
28
+ # Ratio of the count of the approved transactions to the count of total
29
+ # transctions.
30
+ # @return [Float]
31
+ attr_accessor :approved_count_percent
32
+
33
+ # Ratio of the sum of the amount of approved transactions to the sum of the
34
+ # amount of total transctions.
35
+ # @return [Float]
36
+ attr_accessor :approved_amount_percent
37
+
38
+ # Ratio of the count of the declined transactions to the count of total
39
+ # transctions.
40
+ # @return [Float]
41
+ attr_accessor :declined_count_percent
42
+
43
+ # Ratio of the sum of the amount of declined transactions to the sum of the
44
+ # amount of total transctions.
45
+ # @return [Float]
46
+ attr_accessor :declined_amount_percent
47
+
48
+ # The category or classification of a payment card based on the issuing
49
+ # network.
50
+ # @return [String]
51
+ attr_accessor :card_type
52
+
53
+ # The category or classification of a payment card based on the issuing
54
+ # network.
55
+ # @return [CodeAndDescription]
56
+ attr_accessor :card_network
57
+
58
+ # A mapping from model property names to API property names.
59
+ def self.names
60
+ @_hash = {} if @_hash.nil?
61
+ @_hash['approved_count'] = 'approvedCount'
62
+ @_hash['approved_amount'] = 'approvedAmount'
63
+ @_hash['declined_count'] = 'declinedCount'
64
+ @_hash['declined_amount'] = 'declinedAmount'
65
+ @_hash['approved_count_percent'] = 'approvedCountPercent'
66
+ @_hash['approved_amount_percent'] = 'approvedAmountPercent'
67
+ @_hash['declined_count_percent'] = 'declinedCountPercent'
68
+ @_hash['declined_amount_percent'] = 'declinedAmountPercent'
69
+ @_hash['card_type'] = 'cardType'
70
+ @_hash['card_network'] = 'cardNetwork'
71
+ @_hash
72
+ end
73
+
74
+ # An array for optional fields
75
+ def self.optionals
76
+ %w[
77
+ approved_count
78
+ approved_amount
79
+ declined_count
80
+ declined_amount
81
+ approved_count_percent
82
+ approved_amount_percent
83
+ declined_count_percent
84
+ declined_amount_percent
85
+ card_type
86
+ card_network
87
+ ]
88
+ end
89
+
90
+ # An array for nullable fields
91
+ def self.nullables
92
+ []
93
+ end
94
+
95
+ def initialize(approved_count: SKIP, approved_amount: SKIP,
96
+ declined_count: SKIP, declined_amount: SKIP,
97
+ approved_count_percent: SKIP, approved_amount_percent: SKIP,
98
+ declined_count_percent: SKIP, declined_amount_percent: SKIP,
99
+ card_type: SKIP, card_network: SKIP,
100
+ additional_properties: nil)
101
+ # Add additional model properties to the instance
102
+ additional_properties = {} if additional_properties.nil?
103
+
104
+ @approved_count = approved_count unless approved_count == SKIP
105
+ @approved_amount = approved_amount unless approved_amount == SKIP
106
+ @declined_count = declined_count unless declined_count == SKIP
107
+ @declined_amount = declined_amount unless declined_amount == SKIP
108
+ @approved_count_percent = approved_count_percent unless approved_count_percent == SKIP
109
+ @approved_amount_percent = approved_amount_percent unless approved_amount_percent == SKIP
110
+ @declined_count_percent = declined_count_percent unless declined_count_percent == SKIP
111
+ @declined_amount_percent = declined_amount_percent unless declined_amount_percent == SKIP
112
+ @card_type = card_type unless card_type == SKIP
113
+ @card_network = card_network unless card_network == SKIP
114
+ @additional_properties = additional_properties
115
+ end
116
+
117
+ # Creates an instance of the object from a hash.
118
+ def self.from_hash(hash)
119
+ return nil unless hash
120
+
121
+ # Extract variables from the hash.
122
+ approved_count = hash.key?('approvedCount') ? hash['approvedCount'] : SKIP
123
+ approved_amount =
124
+ hash.key?('approvedAmount') ? hash['approvedAmount'] : SKIP
125
+ declined_count = hash.key?('declinedCount') ? hash['declinedCount'] : SKIP
126
+ declined_amount =
127
+ hash.key?('declinedAmount') ? hash['declinedAmount'] : SKIP
128
+ approved_count_percent =
129
+ hash.key?('approvedCountPercent') ? hash['approvedCountPercent'] : SKIP
130
+ approved_amount_percent =
131
+ hash.key?('approvedAmountPercent') ? hash['approvedAmountPercent'] : SKIP
132
+ declined_count_percent =
133
+ hash.key?('declinedCountPercent') ? hash['declinedCountPercent'] : SKIP
134
+ declined_amount_percent =
135
+ hash.key?('declinedAmountPercent') ? hash['declinedAmountPercent'] : SKIP
136
+ card_type = hash.key?('cardType') ? hash['cardType'] : SKIP
137
+ card_network = CodeAndDescription.from_hash(hash['cardNetwork']) if hash['cardNetwork']
138
+
139
+ # Create a new hash for additional properties, removing known properties.
140
+ new_hash = hash.reject { |k, _| names.value?(k) }
141
+
142
+ additional_properties = APIHelper.get_additional_properties(
143
+ new_hash, proc { |value| value }
144
+ )
145
+
146
+ # Create object from extracted values.
147
+ Summary.new(approved_count: approved_count,
148
+ approved_amount: approved_amount,
149
+ declined_count: declined_count,
150
+ declined_amount: declined_amount,
151
+ approved_count_percent: approved_count_percent,
152
+ approved_amount_percent: approved_amount_percent,
153
+ declined_count_percent: declined_count_percent,
154
+ declined_amount_percent: declined_amount_percent,
155
+ card_type: card_type,
156
+ card_network: card_network,
157
+ additional_properties: additional_properties)
158
+ end
159
+
160
+ # Provides a human-readable string representation of the object.
161
+ def to_s
162
+ class_name = self.class.name.split('::').last
163
+ "<#{class_name} approved_count: #{@approved_count}, approved_amount: #{@approved_amount},"\
164
+ " declined_count: #{@declined_count}, declined_amount: #{@declined_amount},"\
165
+ " approved_count_percent: #{@approved_count_percent}, approved_amount_percent:"\
166
+ " #{@approved_amount_percent}, declined_count_percent: #{@declined_count_percent},"\
167
+ " declined_amount_percent: #{@declined_amount_percent}, card_type: #{@card_type},"\
168
+ " card_network: #{@card_network}, additional_properties: #{@additional_properties}>"
169
+ end
170
+
171
+ # Provides a debugging-friendly string with detailed object information.
172
+ def inspect
173
+ class_name = self.class.name.split('::').last
174
+ "<#{class_name} approved_count: #{@approved_count.inspect}, approved_amount:"\
175
+ " #{@approved_amount.inspect}, declined_count: #{@declined_count.inspect}, declined_amount:"\
176
+ " #{@declined_amount.inspect}, approved_count_percent: #{@approved_count_percent.inspect},"\
177
+ " approved_amount_percent: #{@approved_amount_percent.inspect}, declined_count_percent:"\
178
+ " #{@declined_count_percent.inspect}, declined_amount_percent:"\
179
+ " #{@declined_amount_percent.inspect}, card_type: #{@card_type.inspect}, card_network:"\
180
+ " #{@card_network.inspect}, additional_properties: #{@additional_properties}>"
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,173 @@
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
+ # Summary1 Model.
8
+ class Summary1 < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Count of the approved transactions.
13
+ # @return [Integer]
14
+ attr_accessor :approved_count
15
+
16
+ # Sum of the amount of approved transactions.
17
+ # @return [Float]
18
+ attr_accessor :approved_amount
19
+
20
+ # Count of the declined transactions.
21
+ # @return [Integer]
22
+ attr_accessor :declined_count
23
+
24
+ # Sum of the amount of the declined transactions.
25
+ # @return [Float]
26
+ attr_accessor :declined_amount
27
+
28
+ # Ratio of the count of the approved transactions to the count of total
29
+ # transctions.
30
+ # @return [Float]
31
+ attr_accessor :approved_count_percent
32
+
33
+ # Ratio of the sum of the amount of approved transactions to the sum of the
34
+ # amount of total transctions.
35
+ # @return [Float]
36
+ attr_accessor :approved_amount_percent
37
+
38
+ # Ratio of the count of the declined transactions to the count of total
39
+ # transctions.
40
+ # @return [Float]
41
+ attr_accessor :declined_count_percent
42
+
43
+ # Ratio of the sum of the amount of declined transactions to the sum of the
44
+ # amount of total transctions.
45
+ # @return [Float]
46
+ attr_accessor :declined_amount_percent
47
+
48
+ # The transaction date is the specific day when a financial transaction,
49
+ # such as a purchase or sale, takes place officially.
50
+ # @return [String]
51
+ attr_accessor :transaction_date
52
+
53
+ # A mapping from model property names to API property names.
54
+ def self.names
55
+ @_hash = {} if @_hash.nil?
56
+ @_hash['approved_count'] = 'approvedCount'
57
+ @_hash['approved_amount'] = 'approvedAmount'
58
+ @_hash['declined_count'] = 'declinedCount'
59
+ @_hash['declined_amount'] = 'declinedAmount'
60
+ @_hash['approved_count_percent'] = 'approvedCountPercent'
61
+ @_hash['approved_amount_percent'] = 'approvedAmountPercent'
62
+ @_hash['declined_count_percent'] = 'declinedCountPercent'
63
+ @_hash['declined_amount_percent'] = 'declinedAmountPercent'
64
+ @_hash['transaction_date'] = 'transactionDate'
65
+ @_hash
66
+ end
67
+
68
+ # An array for optional fields
69
+ def self.optionals
70
+ %w[
71
+ approved_count
72
+ approved_amount
73
+ declined_count
74
+ declined_amount
75
+ approved_count_percent
76
+ approved_amount_percent
77
+ declined_count_percent
78
+ declined_amount_percent
79
+ transaction_date
80
+ ]
81
+ end
82
+
83
+ # An array for nullable fields
84
+ def self.nullables
85
+ []
86
+ end
87
+
88
+ def initialize(approved_count: SKIP, approved_amount: SKIP,
89
+ declined_count: SKIP, declined_amount: SKIP,
90
+ approved_count_percent: SKIP, approved_amount_percent: SKIP,
91
+ declined_count_percent: SKIP, declined_amount_percent: SKIP,
92
+ transaction_date: SKIP, additional_properties: nil)
93
+ # Add additional model properties to the instance
94
+ additional_properties = {} if additional_properties.nil?
95
+
96
+ @approved_count = approved_count unless approved_count == SKIP
97
+ @approved_amount = approved_amount unless approved_amount == SKIP
98
+ @declined_count = declined_count unless declined_count == SKIP
99
+ @declined_amount = declined_amount unless declined_amount == SKIP
100
+ @approved_count_percent = approved_count_percent unless approved_count_percent == SKIP
101
+ @approved_amount_percent = approved_amount_percent unless approved_amount_percent == SKIP
102
+ @declined_count_percent = declined_count_percent unless declined_count_percent == SKIP
103
+ @declined_amount_percent = declined_amount_percent unless declined_amount_percent == SKIP
104
+ @transaction_date = transaction_date unless transaction_date == SKIP
105
+ @additional_properties = additional_properties
106
+ end
107
+
108
+ # Creates an instance of the object from a hash.
109
+ def self.from_hash(hash)
110
+ return nil unless hash
111
+
112
+ # Extract variables from the hash.
113
+ approved_count = hash.key?('approvedCount') ? hash['approvedCount'] : SKIP
114
+ approved_amount =
115
+ hash.key?('approvedAmount') ? hash['approvedAmount'] : SKIP
116
+ declined_count = hash.key?('declinedCount') ? hash['declinedCount'] : SKIP
117
+ declined_amount =
118
+ hash.key?('declinedAmount') ? hash['declinedAmount'] : SKIP
119
+ approved_count_percent =
120
+ hash.key?('approvedCountPercent') ? hash['approvedCountPercent'] : SKIP
121
+ approved_amount_percent =
122
+ hash.key?('approvedAmountPercent') ? hash['approvedAmountPercent'] : SKIP
123
+ declined_count_percent =
124
+ hash.key?('declinedCountPercent') ? hash['declinedCountPercent'] : SKIP
125
+ declined_amount_percent =
126
+ hash.key?('declinedAmountPercent') ? hash['declinedAmountPercent'] : SKIP
127
+ transaction_date =
128
+ hash.key?('transactionDate') ? hash['transactionDate'] : SKIP
129
+
130
+ # Create a new hash for additional properties, removing known properties.
131
+ new_hash = hash.reject { |k, _| names.value?(k) }
132
+
133
+ additional_properties = APIHelper.get_additional_properties(
134
+ new_hash, proc { |value| value }
135
+ )
136
+
137
+ # Create object from extracted values.
138
+ Summary1.new(approved_count: approved_count,
139
+ approved_amount: approved_amount,
140
+ declined_count: declined_count,
141
+ declined_amount: declined_amount,
142
+ approved_count_percent: approved_count_percent,
143
+ approved_amount_percent: approved_amount_percent,
144
+ declined_count_percent: declined_count_percent,
145
+ declined_amount_percent: declined_amount_percent,
146
+ transaction_date: transaction_date,
147
+ additional_properties: additional_properties)
148
+ end
149
+
150
+ # Provides a human-readable string representation of the object.
151
+ def to_s
152
+ class_name = self.class.name.split('::').last
153
+ "<#{class_name} approved_count: #{@approved_count}, approved_amount: #{@approved_amount},"\
154
+ " declined_count: #{@declined_count}, declined_amount: #{@declined_amount},"\
155
+ " approved_count_percent: #{@approved_count_percent}, approved_amount_percent:"\
156
+ " #{@approved_amount_percent}, declined_count_percent: #{@declined_count_percent},"\
157
+ " declined_amount_percent: #{@declined_amount_percent}, transaction_date:"\
158
+ " #{@transaction_date}, additional_properties: #{@additional_properties}>"
159
+ end
160
+
161
+ # Provides a debugging-friendly string with detailed object information.
162
+ def inspect
163
+ class_name = self.class.name.split('::').last
164
+ "<#{class_name} approved_count: #{@approved_count.inspect}, approved_amount:"\
165
+ " #{@approved_amount.inspect}, declined_count: #{@declined_count.inspect}, declined_amount:"\
166
+ " #{@declined_amount.inspect}, approved_count_percent: #{@approved_count_percent.inspect},"\
167
+ " approved_amount_percent: #{@approved_amount_percent.inspect}, declined_count_percent:"\
168
+ " #{@declined_count_percent.inspect}, declined_amount_percent:"\
169
+ " #{@declined_amount_percent.inspect}, transaction_date: #{@transaction_date.inspect},"\
170
+ " additional_properties: #{@additional_properties}>"
171
+ end
172
+ end
173
+ end