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,98 @@
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
+ # CodeAndDescription Model.
8
+ class CodeAndDescription < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The code.
13
+ # @return [String]
14
+ attr_accessor :code
15
+
16
+ # Short description.
17
+ # @return [String]
18
+ attr_accessor :short_description
19
+
20
+ # Long description.
21
+ # @return [String]
22
+ attr_accessor :long_description
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['code'] = 'code'
28
+ @_hash['short_description'] = 'shortDescription'
29
+ @_hash['long_description'] = 'longDescription'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ code
37
+ short_description
38
+ long_description
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(code: SKIP, short_description: SKIP, long_description: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @code = code unless code == SKIP
53
+ @short_description = short_description unless short_description == SKIP
54
+ @long_description = long_description unless long_description == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ code = hash.key?('code') ? hash['code'] : SKIP
64
+ short_description =
65
+ hash.key?('shortDescription') ? hash['shortDescription'] : SKIP
66
+ long_description =
67
+ hash.key?('longDescription') ? hash['longDescription'] : SKIP
68
+
69
+ # Create a new hash for additional properties, removing known properties.
70
+ new_hash = hash.reject { |k, _| names.value?(k) }
71
+
72
+ additional_properties = APIHelper.get_additional_properties(
73
+ new_hash, proc { |value| value }
74
+ )
75
+
76
+ # Create object from extracted values.
77
+ CodeAndDescription.new(code: code,
78
+ short_description: short_description,
79
+ long_description: long_description,
80
+ additional_properties: additional_properties)
81
+ end
82
+
83
+ # Provides a human-readable string representation of the object.
84
+ def to_s
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} code: #{@code}, short_description: #{@short_description}, long_description:"\
87
+ " #{@long_description}, additional_properties: #{@additional_properties}>"
88
+ end
89
+
90
+ # Provides a debugging-friendly string with detailed object information.
91
+ def inspect
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} code: #{@code.inspect}, short_description: #{@short_description.inspect},"\
94
+ " long_description: #{@long_description.inspect}, additional_properties:"\
95
+ " #{@additional_properties}>"
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,161 @@
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
+ # CommonSummaryDetail Model.
8
+ class CommonSummaryDetail < 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
+ # A mapping from model property names to API property names.
49
+ def self.names
50
+ @_hash = {} if @_hash.nil?
51
+ @_hash['approved_count'] = 'approvedCount'
52
+ @_hash['approved_amount'] = 'approvedAmount'
53
+ @_hash['declined_count'] = 'declinedCount'
54
+ @_hash['declined_amount'] = 'declinedAmount'
55
+ @_hash['approved_count_percent'] = 'approvedCountPercent'
56
+ @_hash['approved_amount_percent'] = 'approvedAmountPercent'
57
+ @_hash['declined_count_percent'] = 'declinedCountPercent'
58
+ @_hash['declined_amount_percent'] = 'declinedAmountPercent'
59
+ @_hash
60
+ end
61
+
62
+ # An array for optional fields
63
+ def self.optionals
64
+ %w[
65
+ approved_count
66
+ approved_amount
67
+ declined_count
68
+ declined_amount
69
+ approved_count_percent
70
+ approved_amount_percent
71
+ declined_count_percent
72
+ declined_amount_percent
73
+ ]
74
+ end
75
+
76
+ # An array for nullable fields
77
+ def self.nullables
78
+ []
79
+ end
80
+
81
+ def initialize(approved_count: SKIP, approved_amount: SKIP,
82
+ declined_count: SKIP, declined_amount: SKIP,
83
+ approved_count_percent: SKIP, approved_amount_percent: SKIP,
84
+ declined_count_percent: SKIP, declined_amount_percent: SKIP,
85
+ additional_properties: nil)
86
+ # Add additional model properties to the instance
87
+ additional_properties = {} if additional_properties.nil?
88
+
89
+ @approved_count = approved_count unless approved_count == SKIP
90
+ @approved_amount = approved_amount unless approved_amount == SKIP
91
+ @declined_count = declined_count unless declined_count == SKIP
92
+ @declined_amount = declined_amount unless declined_amount == SKIP
93
+ @approved_count_percent = approved_count_percent unless approved_count_percent == SKIP
94
+ @approved_amount_percent = approved_amount_percent unless approved_amount_percent == SKIP
95
+ @declined_count_percent = declined_count_percent unless declined_count_percent == SKIP
96
+ @declined_amount_percent = declined_amount_percent unless declined_amount_percent == SKIP
97
+ @additional_properties = additional_properties
98
+ end
99
+
100
+ # Creates an instance of the object from a hash.
101
+ def self.from_hash(hash)
102
+ return nil unless hash
103
+
104
+ # Extract variables from the hash.
105
+ approved_count = hash.key?('approvedCount') ? hash['approvedCount'] : SKIP
106
+ approved_amount =
107
+ hash.key?('approvedAmount') ? hash['approvedAmount'] : SKIP
108
+ declined_count = hash.key?('declinedCount') ? hash['declinedCount'] : SKIP
109
+ declined_amount =
110
+ hash.key?('declinedAmount') ? hash['declinedAmount'] : SKIP
111
+ approved_count_percent =
112
+ hash.key?('approvedCountPercent') ? hash['approvedCountPercent'] : SKIP
113
+ approved_amount_percent =
114
+ hash.key?('approvedAmountPercent') ? hash['approvedAmountPercent'] : SKIP
115
+ declined_count_percent =
116
+ hash.key?('declinedCountPercent') ? hash['declinedCountPercent'] : SKIP
117
+ declined_amount_percent =
118
+ hash.key?('declinedAmountPercent') ? hash['declinedAmountPercent'] : SKIP
119
+
120
+ # Create a new hash for additional properties, removing known properties.
121
+ new_hash = hash.reject { |k, _| names.value?(k) }
122
+
123
+ additional_properties = APIHelper.get_additional_properties(
124
+ new_hash, proc { |value| value }
125
+ )
126
+
127
+ # Create object from extracted values.
128
+ CommonSummaryDetail.new(approved_count: approved_count,
129
+ approved_amount: approved_amount,
130
+ declined_count: declined_count,
131
+ declined_amount: declined_amount,
132
+ approved_count_percent: approved_count_percent,
133
+ approved_amount_percent: approved_amount_percent,
134
+ declined_count_percent: declined_count_percent,
135
+ declined_amount_percent: declined_amount_percent,
136
+ additional_properties: additional_properties)
137
+ end
138
+
139
+ # Provides a human-readable string representation of the object.
140
+ def to_s
141
+ class_name = self.class.name.split('::').last
142
+ "<#{class_name} approved_count: #{@approved_count}, approved_amount: #{@approved_amount},"\
143
+ " declined_count: #{@declined_count}, declined_amount: #{@declined_amount},"\
144
+ " approved_count_percent: #{@approved_count_percent}, approved_amount_percent:"\
145
+ " #{@approved_amount_percent}, declined_count_percent: #{@declined_count_percent},"\
146
+ " declined_amount_percent: #{@declined_amount_percent}, additional_properties:"\
147
+ " #{@additional_properties}>"
148
+ end
149
+
150
+ # Provides a debugging-friendly string with detailed object information.
151
+ def inspect
152
+ class_name = self.class.name.split('::').last
153
+ "<#{class_name} approved_count: #{@approved_count.inspect}, approved_amount:"\
154
+ " #{@approved_amount.inspect}, declined_count: #{@declined_count.inspect}, declined_amount:"\
155
+ " #{@declined_amount.inspect}, approved_count_percent: #{@approved_count_percent.inspect},"\
156
+ " approved_amount_percent: #{@approved_amount_percent.inspect}, declined_count_percent:"\
157
+ " #{@declined_count_percent.inspect}, declined_amount_percent:"\
158
+ " #{@declined_amount_percent.inspect}, additional_properties: #{@additional_properties}>"
159
+ end
160
+ end
161
+ end
@@ -0,0 +1,213 @@
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
+ # CommonSummaryResponses Model.
8
+ class CommonSummaryResponses < 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
+ # A mapping from model property names to API property names.
63
+ def self.names
64
+ @_hash = {} if @_hash.nil?
65
+ @_hash['pagination'] = 'pagination'
66
+ @_hash['total_approved_count'] = 'totalApprovedCount'
67
+ @_hash['total_approved_amount'] = 'totalApprovedAmount'
68
+ @_hash['total_declined_count'] = 'totalDeclinedCount'
69
+ @_hash['total_declined_amount'] = 'totalDeclinedAmount'
70
+ @_hash['total_approved_count_percent'] = 'totalApprovedCountPercent'
71
+ @_hash['total_approved_amount_percent'] = 'totalApprovedAmountPercent'
72
+ @_hash['total_declined_count_percent'] = 'totalDeclinedCountPercent'
73
+ @_hash['total_declined_amount_percent'] = 'totalDeclinedAmountPercent'
74
+ @_hash['total_count'] = 'totalCount'
75
+ @_hash['total_amount'] = 'totalAmount'
76
+ @_hash
77
+ end
78
+
79
+ # An array for optional fields
80
+ def self.optionals
81
+ %w[
82
+ pagination
83
+ total_approved_count
84
+ total_approved_amount
85
+ total_declined_count
86
+ total_declined_amount
87
+ total_approved_count_percent
88
+ total_approved_amount_percent
89
+ total_declined_count_percent
90
+ total_declined_amount_percent
91
+ total_count
92
+ total_amount
93
+ ]
94
+ end
95
+
96
+ # An array for nullable fields
97
+ def self.nullables
98
+ []
99
+ end
100
+
101
+ def initialize(pagination: SKIP, total_approved_count: SKIP,
102
+ total_approved_amount: SKIP, total_declined_count: SKIP,
103
+ total_declined_amount: SKIP,
104
+ total_approved_count_percent: SKIP,
105
+ total_approved_amount_percent: SKIP,
106
+ total_declined_count_percent: SKIP,
107
+ total_declined_amount_percent: SKIP, total_count: SKIP,
108
+ total_amount: SKIP, additional_properties: nil)
109
+ # Add additional model properties to the instance
110
+ additional_properties = {} if additional_properties.nil?
111
+
112
+ @pagination = pagination unless pagination == SKIP
113
+ @total_approved_count = total_approved_count unless total_approved_count == SKIP
114
+ @total_approved_amount = total_approved_amount unless total_approved_amount == SKIP
115
+ @total_declined_count = total_declined_count unless total_declined_count == SKIP
116
+ @total_declined_amount = total_declined_amount unless total_declined_amount == SKIP
117
+ unless total_approved_count_percent == SKIP
118
+ @total_approved_count_percent =
119
+ total_approved_count_percent
120
+ end
121
+ unless total_approved_amount_percent == SKIP
122
+ @total_approved_amount_percent =
123
+ total_approved_amount_percent
124
+ end
125
+ unless total_declined_count_percent == SKIP
126
+ @total_declined_count_percent =
127
+ total_declined_count_percent
128
+ end
129
+ unless total_declined_amount_percent == SKIP
130
+ @total_declined_amount_percent =
131
+ total_declined_amount_percent
132
+ end
133
+ @total_count = total_count unless total_count == SKIP
134
+ @total_amount = total_amount unless total_amount == SKIP
135
+ @additional_properties = additional_properties
136
+ end
137
+
138
+ # Creates an instance of the object from a hash.
139
+ def self.from_hash(hash)
140
+ return nil unless hash
141
+
142
+ # Extract variables from the hash.
143
+ pagination = PaginationResponse.from_hash(hash['pagination']) if hash['pagination']
144
+ total_approved_count =
145
+ hash.key?('totalApprovedCount') ? hash['totalApprovedCount'] : SKIP
146
+ total_approved_amount =
147
+ hash.key?('totalApprovedAmount') ? hash['totalApprovedAmount'] : SKIP
148
+ total_declined_count =
149
+ hash.key?('totalDeclinedCount') ? hash['totalDeclinedCount'] : SKIP
150
+ total_declined_amount =
151
+ hash.key?('totalDeclinedAmount') ? hash['totalDeclinedAmount'] : SKIP
152
+ total_approved_count_percent =
153
+ hash.key?('totalApprovedCountPercent') ? hash['totalApprovedCountPercent'] : SKIP
154
+ total_approved_amount_percent =
155
+ hash.key?('totalApprovedAmountPercent') ? hash['totalApprovedAmountPercent'] : SKIP
156
+ total_declined_count_percent =
157
+ hash.key?('totalDeclinedCountPercent') ? hash['totalDeclinedCountPercent'] : SKIP
158
+ total_declined_amount_percent =
159
+ hash.key?('totalDeclinedAmountPercent') ? hash['totalDeclinedAmountPercent'] : SKIP
160
+ total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
161
+ total_amount = hash.key?('totalAmount') ? hash['totalAmount'] : SKIP
162
+
163
+ # Create a new hash for additional properties, removing known properties.
164
+ new_hash = hash.reject { |k, _| names.value?(k) }
165
+
166
+ additional_properties = APIHelper.get_additional_properties(
167
+ new_hash, proc { |value| value }
168
+ )
169
+
170
+ # Create object from extracted values.
171
+ CommonSummaryResponses.new(pagination: pagination,
172
+ total_approved_count: total_approved_count,
173
+ total_approved_amount: total_approved_amount,
174
+ total_declined_count: total_declined_count,
175
+ total_declined_amount: total_declined_amount,
176
+ total_approved_count_percent: total_approved_count_percent,
177
+ total_approved_amount_percent: total_approved_amount_percent,
178
+ total_declined_count_percent: total_declined_count_percent,
179
+ total_declined_amount_percent: total_declined_amount_percent,
180
+ total_count: total_count,
181
+ total_amount: total_amount,
182
+ additional_properties: additional_properties)
183
+ end
184
+
185
+ # Provides a human-readable string representation of the object.
186
+ def to_s
187
+ class_name = self.class.name.split('::').last
188
+ "<#{class_name} pagination: #{@pagination}, total_approved_count: #{@total_approved_count},"\
189
+ " total_approved_amount: #{@total_approved_amount}, total_declined_count:"\
190
+ " #{@total_declined_count}, total_declined_amount: #{@total_declined_amount},"\
191
+ " total_approved_count_percent: #{@total_approved_count_percent},"\
192
+ " total_approved_amount_percent: #{@total_approved_amount_percent},"\
193
+ " total_declined_count_percent: #{@total_declined_count_percent},"\
194
+ " total_declined_amount_percent: #{@total_declined_amount_percent}, total_count:"\
195
+ " #{@total_count}, total_amount: #{@total_amount}, additional_properties:"\
196
+ " #{@additional_properties}>"
197
+ end
198
+
199
+ # Provides a debugging-friendly string with detailed object information.
200
+ def inspect
201
+ class_name = self.class.name.split('::').last
202
+ "<#{class_name} pagination: #{@pagination.inspect}, total_approved_count:"\
203
+ " #{@total_approved_count.inspect}, total_approved_amount:"\
204
+ " #{@total_approved_amount.inspect}, total_declined_count: #{@total_declined_count.inspect},"\
205
+ " total_declined_amount: #{@total_declined_amount.inspect}, total_approved_count_percent:"\
206
+ " #{@total_approved_count_percent.inspect}, total_approved_amount_percent:"\
207
+ " #{@total_approved_amount_percent.inspect}, total_declined_count_percent:"\
208
+ " #{@total_declined_count_percent.inspect}, total_declined_amount_percent:"\
209
+ " #{@total_declined_amount_percent.inspect}, total_count: #{@total_count.inspect},"\
210
+ " total_amount: #{@total_amount.inspect}, additional_properties: #{@additional_properties}>"
211
+ end
212
+ end
213
+ end
@@ -0,0 +1,82 @@
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
+ # DateRange Model.
8
+ class DateRange < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The starting date of the specified time period.
13
+ # @return [String]
14
+ attr_accessor :from_date
15
+
16
+ # The end date of the specified time period.
17
+ # @return [String]
18
+ attr_accessor :to_date
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['from_date'] = 'fromDate'
24
+ @_hash['to_date'] = 'toDate'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ []
31
+ end
32
+
33
+ # An array for nullable fields
34
+ def self.nullables
35
+ []
36
+ end
37
+
38
+ def initialize(from_date:, to_date:, additional_properties: nil)
39
+ # Add additional model properties to the instance
40
+ additional_properties = {} if additional_properties.nil?
41
+
42
+ @from_date = from_date
43
+ @to_date = to_date
44
+ @additional_properties = additional_properties
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ from_date = hash.key?('fromDate') ? hash['fromDate'] : nil
53
+ to_date = hash.key?('toDate') ? hash['toDate'] : nil
54
+
55
+ # Create a new hash for additional properties, removing known properties.
56
+ new_hash = hash.reject { |k, _| names.value?(k) }
57
+
58
+ additional_properties = APIHelper.get_additional_properties(
59
+ new_hash, proc { |value| value }
60
+ )
61
+
62
+ # Create object from extracted values.
63
+ DateRange.new(from_date: from_date,
64
+ to_date: to_date,
65
+ additional_properties: additional_properties)
66
+ end
67
+
68
+ # Provides a human-readable string representation of the object.
69
+ def to_s
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} from_date: #{@from_date}, to_date: #{@to_date}, additional_properties:"\
72
+ " #{@additional_properties}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} from_date: #{@from_date.inspect}, to_date: #{@to_date.inspect},"\
79
+ " additional_properties: #{@additional_properties}>"
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,85 @@
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
+ # All dates including and between a specified start and end date. <br> Date
8
+ # range for different hierarchy level:<br><br>07 Days:<br>Independent Sales
9
+ # Organizationn(SO),Independent Sales Affiliate(SA), National(NL),
10
+ # Partner(PT), SuperChain(SC)<br><br>45 days:<br>Chain(CH), Merchant(MT).
11
+ class DateRangeType < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # The starting date of the specified time period.
16
+ # @return [String]
17
+ attr_accessor :from_date
18
+
19
+ # The end date of the specified time period.
20
+ # @return [String]
21
+ attr_accessor :to_date
22
+
23
+ # A mapping from model property names to API property names.
24
+ def self.names
25
+ @_hash = {} if @_hash.nil?
26
+ @_hash['from_date'] = 'fromDate'
27
+ @_hash['to_date'] = 'toDate'
28
+ @_hash
29
+ end
30
+
31
+ # An array for optional fields
32
+ def self.optionals
33
+ []
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(from_date:, to_date:, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @from_date = from_date
46
+ @to_date = to_date
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
+ from_date = hash.key?('fromDate') ? hash['fromDate'] : nil
56
+ to_date = hash.key?('toDate') ? hash['toDate'] : nil
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
+ DateRangeType.new(from_date: from_date,
67
+ to_date: to_date,
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} from_date: #{@from_date}, to_date: #{@to_date}, 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} from_date: #{@from_date.inspect}, to_date: #{@to_date.inspect},"\
82
+ " additional_properties: #{@additional_properties}>"
83
+ end
84
+ end
85
+ end