payzu-pix 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +231 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +141 -0
- data/docs/ApiErrorDetailsInner.md +20 -0
- data/docs/BankStatement.md +42 -0
- data/docs/BankStatementListResponse.md +20 -0
- data/docs/BankStatementListResponsePagination.md +22 -0
- data/docs/CallbackDetail.md +34 -0
- data/docs/CallbackListResponse.md +20 -0
- data/docs/CallbackListResponsePagination.md +22 -0
- data/docs/CallbackSecretResponse.md +20 -0
- data/docs/CallbacksApi.md +587 -0
- data/docs/Defense.md +30 -0
- data/docs/DefenseFilesInner.md +24 -0
- data/docs/DefenseHistoryEntry.md +28 -0
- data/docs/DefenseHistoryEntryFilesInner.md +22 -0
- data/docs/DepositPending.md +62 -0
- data/docs/DepositPendingListResponse.md +24 -0
- data/docs/DictConsultResponse.md +30 -0
- data/docs/DownloadUserReport200Response.md +20 -0
- data/docs/EnqueuedCallback.md +18 -0
- data/docs/EnqueuedCallbackEnqueued.md +22 -0
- data/docs/EnqueuedCallbackItem.md +22 -0
- data/docs/ErrorResponse.md +32 -0
- data/docs/GetUser200Response.md +46 -0
- data/docs/GetUser200ResponseDailyWithdrawLimit.md +24 -0
- data/docs/GetUser200ResponseServiceFee.md +28 -0
- data/docs/GetUserBalance200Response.md +20 -0
- data/docs/GetUserTransactionById200Response.md +94 -0
- data/docs/GetUserTransactionById200ResponseAllOfCallbackLogInner.md +26 -0
- data/docs/GetUserTransactionById200ResponseAllOfInfractionInner.md +24 -0
- data/docs/GetUserTransactions200Response.md +22 -0
- data/docs/InfractionDetail.md +40 -0
- data/docs/InfractionDetailTransaction.md +30 -0
- data/docs/InfractionListResponse.md +20 -0
- data/docs/InfractionListResponsePagination.md +24 -0
- data/docs/InfractionsApi.md +413 -0
- data/docs/InternalTransferApi.md +153 -0
- data/docs/KeysAndDICTApi.md +217 -0
- data/docs/ListUserReports200Response.md +22 -0
- data/docs/PixKeyInfo.md +36 -0
- data/docs/PixOperationsApi.md +299 -0
- data/docs/PostInternalTransferRequest.md +30 -0
- data/docs/PostPixQrcodeReadRequest.md +18 -0
- data/docs/PostPixRequest.md +32 -0
- data/docs/PostUserReportRequest.md +24 -0
- data/docs/PostWithdrawQrcodeRequest.md +28 -0
- data/docs/PostWithdrawRequest.md +30 -0
- data/docs/ProofResponse.md +18 -0
- data/docs/QRCodeReadResponse.md +38 -0
- data/docs/Refund.md +34 -0
- data/docs/RefundRequest.md +22 -0
- data/docs/RefundsApi.md +79 -0
- data/docs/ReportJob.md +30 -0
- data/docs/ReportJobAccepted.md +30 -0
- data/docs/ReportJobDetail.md +30 -0
- data/docs/ReportsApi.md +881 -0
- data/docs/ResendUserCallbackSingle200Response.md +18 -0
- data/docs/ResendUserCallbacks200Response.md +20 -0
- data/docs/ResendUserCallbacksRequest.md +28 -0
- data/docs/ResendWebhookCallbacksRequest.md +30 -0
- data/docs/RotateCallbackSecretResponse.md +18 -0
- data/docs/RotateSecretResponse.md +18 -0
- data/docs/SentWebhookDetail.md +40 -0
- data/docs/SentWebhookDetailResponse.md +18 -0
- data/docs/SentWebhooksQuantity.md +18 -0
- data/docs/Summary.md +26 -0
- data/docs/SummaryBlock.md +24 -0
- data/docs/SummaryBlockGroupedInner.md +20 -0
- data/docs/SummaryBlockStatuses.md +26 -0
- data/docs/SummaryStatus.md +22 -0
- data/docs/Transaction.md +90 -0
- data/docs/TransactionWithRefunds.md +92 -0
- data/docs/Webhook.md +30 -0
- data/docs/WebhookCreateRequest.md +24 -0
- data/docs/WebhookEventType.md +15 -0
- data/docs/WebhookListResponse.md +18 -0
- data/docs/WebhookUpdateRequest.md +22 -0
- data/docs/WebhookWithSecret.md +32 -0
- data/docs/WebhooksApi.md +574 -0
- data/docs/WithdrawalsApi.md +299 -0
- data/git_push.sh +57 -0
- data/lib/payzu-pix/api/account_api.rb +136 -0
- data/lib/payzu-pix/api/callbacks_api.rb +577 -0
- data/lib/payzu-pix/api/infractions_api.rb +452 -0
- data/lib/payzu-pix/api/internal_transfer_api.rb +164 -0
- data/lib/payzu-pix/api/keys_and_dict_api.rb +234 -0
- data/lib/payzu-pix/api/pix_operations_api.rb +300 -0
- data/lib/payzu-pix/api/refunds_api.rb +96 -0
- data/lib/payzu-pix/api/reports_api.rb +968 -0
- data/lib/payzu-pix/api/webhooks_api.rb +542 -0
- data/lib/payzu-pix/api/withdrawals_api.rb +305 -0
- data/lib/payzu-pix/api_client.rb +441 -0
- data/lib/payzu-pix/api_error.rb +58 -0
- data/lib/payzu-pix/api_model_base.rb +88 -0
- data/lib/payzu-pix/configuration.rb +392 -0
- data/lib/payzu-pix/models/api_error_details_inner.rb +192 -0
- data/lib/payzu-pix/models/bank_statement.rb +296 -0
- data/lib/payzu-pix/models/bank_statement_list_response.rb +159 -0
- data/lib/payzu-pix/models/bank_statement_list_response_pagination.rb +169 -0
- data/lib/payzu-pix/models/callback_detail.rb +228 -0
- data/lib/payzu-pix/models/callback_list_response.rb +159 -0
- data/lib/payzu-pix/models/callback_list_response_pagination.rb +169 -0
- data/lib/payzu-pix/models/callback_secret_response.rb +158 -0
- data/lib/payzu-pix/models/defense.rb +234 -0
- data/lib/payzu-pix/models/defense_files_inner.rb +179 -0
- data/lib/payzu-pix/models/defense_history_entry.rb +225 -0
- data/lib/payzu-pix/models/defense_history_entry_files_inner.rb +168 -0
- data/lib/payzu-pix/models/deposit_pending.rb +407 -0
- data/lib/payzu-pix/models/deposit_pending_list_response.rb +180 -0
- data/lib/payzu-pix/models/dict_consult_response.rb +231 -0
- data/lib/payzu-pix/models/download_user_report200_response.rb +158 -0
- data/lib/payzu-pix/models/enqueued_callback.rb +147 -0
- data/lib/payzu-pix/models/enqueued_callback_enqueued.rb +170 -0
- data/lib/payzu-pix/models/enqueued_callback_item.rb +190 -0
- data/lib/payzu-pix/models/error_response.rb +336 -0
- data/lib/payzu-pix/models/get_user200_response.rb +334 -0
- data/lib/payzu-pix/models/get_user200_response_daily_withdraw_limit.rb +180 -0
- data/lib/payzu-pix/models/get_user200_response_service_fee.rb +199 -0
- data/lib/payzu-pix/models/get_user_balance200_response.rb +158 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response.rb +595 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_callback_log_inner.rb +188 -0
- data/lib/payzu-pix/models/get_user_transaction_by_id200_response_all_of_infraction_inner.rb +202 -0
- data/lib/payzu-pix/models/get_user_transactions200_response.rb +170 -0
- data/lib/payzu-pix/models/infraction_detail.rb +293 -0
- data/lib/payzu-pix/models/infraction_detail_transaction.rb +213 -0
- data/lib/payzu-pix/models/infraction_list_response.rb +159 -0
- data/lib/payzu-pix/models/infraction_list_response_pagination.rb +179 -0
- data/lib/payzu-pix/models/list_user_reports200_response.rb +170 -0
- data/lib/payzu-pix/models/pix_key_info.rb +263 -0
- data/lib/payzu-pix/models/post_internal_transfer_request.rb +377 -0
- data/lib/payzu-pix/models/post_pix_qrcode_read_request.rb +174 -0
- data/lib/payzu-pix/models/post_pix_request.rb +382 -0
- data/lib/payzu-pix/models/post_user_report_request.rb +238 -0
- data/lib/payzu-pix/models/post_withdraw_qrcode_request.rb +302 -0
- data/lib/payzu-pix/models/post_withdraw_request.rb +350 -0
- data/lib/payzu-pix/models/proof_response.rb +148 -0
- data/lib/payzu-pix/models/qr_code_read_response.rb +283 -0
- data/lib/payzu-pix/models/refund.rb +257 -0
- data/lib/payzu-pix/models/refund_request.rb +215 -0
- data/lib/payzu-pix/models/report_job.rb +234 -0
- data/lib/payzu-pix/models/report_job_accepted.rb +237 -0
- data/lib/payzu-pix/models/report_job_detail.rb +237 -0
- data/lib/payzu-pix/models/resend_user_callback_single200_response.rb +148 -0
- data/lib/payzu-pix/models/resend_user_callbacks200_response.rb +158 -0
- data/lib/payzu-pix/models/resend_user_callbacks_request.rb +262 -0
- data/lib/payzu-pix/models/resend_webhook_callbacks_request.rb +274 -0
- data/lib/payzu-pix/models/rotate_callback_secret_response.rb +148 -0
- data/lib/payzu-pix/models/rotate_secret_response.rb +148 -0
- data/lib/payzu-pix/models/sent_webhook_detail.rb +261 -0
- data/lib/payzu-pix/models/sent_webhook_detail_response.rb +164 -0
- data/lib/payzu-pix/models/sent_webhooks_quantity.rb +148 -0
- data/lib/payzu-pix/models/summary.rb +188 -0
- data/lib/payzu-pix/models/summary_block.rb +179 -0
- data/lib/payzu-pix/models/summary_block_grouped_inner.rb +158 -0
- data/lib/payzu-pix/models/summary_block_statuses.rb +189 -0
- data/lib/payzu-pix/models/summary_status.rb +168 -0
- data/lib/payzu-pix/models/transaction.rb +588 -0
- data/lib/payzu-pix/models/transaction_with_refunds.rb +583 -0
- data/lib/payzu-pix/models/webhook.rb +210 -0
- data/lib/payzu-pix/models/webhook_create_request.rb +201 -0
- data/lib/payzu-pix/models/webhook_event_type.rb +47 -0
- data/lib/payzu-pix/models/webhook_list_response.rb +150 -0
- data/lib/payzu-pix/models/webhook_update_request.rb +171 -0
- data/lib/payzu-pix/models/webhook_with_secret.rb +220 -0
- data/lib/payzu-pix/version.rb +15 -0
- data/lib/payzu-pix.rb +119 -0
- data/payzu-pix.gemspec +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +283 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PayZu Pix API
|
|
3
|
+
|
|
4
|
+
#REST API for Pix operations on the PayZu platform, deposits, withdrawals, internal transfers, infractions, reports, and callback inspection. All amounts are in BRL (reais) unless explicitly noted. Authentication uses a Bearer token issued during onboarding. ## SDKs oficiais - Node.js: `npm install payzu-pix` - Python: `pip install payzu-pix` - PHP: `composer require payzu/pix` - Ruby: `gem install payzu-pix` - Java: `br.com.payzu:payzu-pix` (Maven Central) - Go: `go get github.com/PayZuAI/payzu-sdks/go/v2` Repo: https://github.com/PayZuAI/payzu-sdks
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.8.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PayZuPix
|
|
17
|
+
class EnqueuedCallbackItem < ApiModelBase
|
|
18
|
+
# Transaction whose callback was queued.
|
|
19
|
+
attr_accessor :transaction_id
|
|
20
|
+
|
|
21
|
+
# Webhook that receives the delivery.
|
|
22
|
+
attr_accessor :webhook_id
|
|
23
|
+
|
|
24
|
+
# Event that triggered the callback, when the log records it.
|
|
25
|
+
attr_accessor :event_type
|
|
26
|
+
|
|
27
|
+
class EnumAttributeValidator
|
|
28
|
+
attr_reader :datatype
|
|
29
|
+
attr_reader :allowable_values
|
|
30
|
+
|
|
31
|
+
def initialize(datatype, allowable_values)
|
|
32
|
+
@allowable_values = allowable_values.map do |value|
|
|
33
|
+
case datatype.to_s
|
|
34
|
+
when /Integer/i
|
|
35
|
+
value.to_i
|
|
36
|
+
when /Float/i
|
|
37
|
+
value.to_f
|
|
38
|
+
else
|
|
39
|
+
value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def valid?(value)
|
|
45
|
+
!value || allowable_values.include?(value)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
|
+
def self.attribute_map
|
|
51
|
+
{
|
|
52
|
+
:'transaction_id' => :'transactionId',
|
|
53
|
+
:'webhook_id' => :'webhookId',
|
|
54
|
+
:'event_type' => :'eventType'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'transaction_id' => :'String',
|
|
72
|
+
:'webhook_id' => :'String',
|
|
73
|
+
:'event_type' => :'WebhookEventType'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# List of attributes with nullable: true
|
|
78
|
+
def self.openapi_nullable
|
|
79
|
+
Set.new([
|
|
80
|
+
])
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Initializes the object
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
|
+
def initialize(attributes = {})
|
|
86
|
+
if (!attributes.is_a?(Hash))
|
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::EnqueuedCallbackItem` initialize method"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
93
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::EnqueuedCallbackItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
95
|
+
end
|
|
96
|
+
h[k.to_sym] = v
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'transaction_id')
|
|
100
|
+
self.transaction_id = attributes[:'transaction_id']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'webhook_id')
|
|
104
|
+
self.webhook_id = attributes[:'webhook_id']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'event_type')
|
|
108
|
+
self.event_type = attributes[:'event_type']
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
113
|
+
# @return Array for valid properties with the reasons
|
|
114
|
+
def list_invalid_properties
|
|
115
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
116
|
+
invalid_properties = Array.new
|
|
117
|
+
invalid_properties
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Check to see if the all the properties in the model are valid
|
|
121
|
+
# @return true if the model is valid
|
|
122
|
+
def valid?
|
|
123
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Checks equality by comparing each attribute.
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def ==(o)
|
|
130
|
+
return true if self.equal?(o)
|
|
131
|
+
self.class == o.class &&
|
|
132
|
+
transaction_id == o.transaction_id &&
|
|
133
|
+
webhook_id == o.webhook_id &&
|
|
134
|
+
event_type == o.event_type
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[transaction_id, webhook_id, event_type].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PayZu Pix API
|
|
3
|
+
|
|
4
|
+
#REST API for Pix operations on the PayZu platform, deposits, withdrawals, internal transfers, infractions, reports, and callback inspection. All amounts are in BRL (reais) unless explicitly noted. Authentication uses a Bearer token issued during onboarding. ## SDKs oficiais - Node.js: `npm install payzu-pix` - Python: `pip install payzu-pix` - PHP: `composer require payzu/pix` - Ruby: `gem install payzu-pix` - Java: `br.com.payzu:payzu-pix` (Maven Central) - Go: `go get github.com/PayZuAI/payzu-sdks/go/v2` Repo: https://github.com/PayZuAI/payzu-sdks
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.8.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PayZuPix
|
|
17
|
+
class ErrorResponse < ApiModelBase
|
|
18
|
+
# Fixed marker of an error response.
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
|
|
21
|
+
# Name of the corresponding HTTP status.
|
|
22
|
+
attr_accessor :error
|
|
23
|
+
|
|
24
|
+
# Stable machine-readable error code, when available.
|
|
25
|
+
attr_accessor :error_code
|
|
26
|
+
|
|
27
|
+
# Human-readable error message.
|
|
28
|
+
attr_accessor :message
|
|
29
|
+
|
|
30
|
+
# HTTP status code.
|
|
31
|
+
attr_accessor :status_code
|
|
32
|
+
|
|
33
|
+
# Unique request correlation ID (cuid). Include it when contacting support.
|
|
34
|
+
attr_accessor :request_id
|
|
35
|
+
|
|
36
|
+
# Field-level validation errors, when applicable.
|
|
37
|
+
attr_accessor :details
|
|
38
|
+
|
|
39
|
+
# Seconds to wait before retrying. Present only on 429 responses.
|
|
40
|
+
attr_accessor :retry_after_seconds
|
|
41
|
+
|
|
42
|
+
class EnumAttributeValidator
|
|
43
|
+
attr_reader :datatype
|
|
44
|
+
attr_reader :allowable_values
|
|
45
|
+
|
|
46
|
+
def initialize(datatype, allowable_values)
|
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
|
48
|
+
case datatype.to_s
|
|
49
|
+
when /Integer/i
|
|
50
|
+
value.to_i
|
|
51
|
+
when /Float/i
|
|
52
|
+
value.to_f
|
|
53
|
+
else
|
|
54
|
+
value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def valid?(value)
|
|
60
|
+
!value || allowable_values.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
65
|
+
def self.attribute_map
|
|
66
|
+
{
|
|
67
|
+
:'status' => :'status',
|
|
68
|
+
:'error' => :'error',
|
|
69
|
+
:'error_code' => :'errorCode',
|
|
70
|
+
:'message' => :'message',
|
|
71
|
+
:'status_code' => :'statusCode',
|
|
72
|
+
:'request_id' => :'requestId',
|
|
73
|
+
:'details' => :'details',
|
|
74
|
+
:'retry_after_seconds' => :'retryAfterSeconds'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns attribute mapping this model knows about
|
|
79
|
+
def self.acceptable_attribute_map
|
|
80
|
+
attribute_map
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Returns all the JSON keys this model knows about
|
|
84
|
+
def self.acceptable_attributes
|
|
85
|
+
acceptable_attribute_map.values
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Attribute type mapping.
|
|
89
|
+
def self.openapi_types
|
|
90
|
+
{
|
|
91
|
+
:'status' => :'String',
|
|
92
|
+
:'error' => :'String',
|
|
93
|
+
:'error_code' => :'String',
|
|
94
|
+
:'message' => :'String',
|
|
95
|
+
:'status_code' => :'Integer',
|
|
96
|
+
:'request_id' => :'String',
|
|
97
|
+
:'details' => :'Array<ApiErrorDetailsInner>',
|
|
98
|
+
:'retry_after_seconds' => :'Integer'
|
|
99
|
+
}
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# List of attributes with nullable: true
|
|
103
|
+
def self.openapi_nullable
|
|
104
|
+
Set.new([
|
|
105
|
+
])
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Initializes the object
|
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
110
|
+
def initialize(attributes = {})
|
|
111
|
+
if (!attributes.is_a?(Hash))
|
|
112
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PayZuPix::ErrorResponse` initialize method"
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
116
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
117
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
118
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PayZuPix::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
120
|
+
end
|
|
121
|
+
h[k.to_sym] = v
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'status')
|
|
125
|
+
self.status = attributes[:'status']
|
|
126
|
+
else
|
|
127
|
+
self.status = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'error')
|
|
131
|
+
self.error = attributes[:'error']
|
|
132
|
+
else
|
|
133
|
+
self.error = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'error_code')
|
|
137
|
+
self.error_code = attributes[:'error_code']
|
|
138
|
+
else
|
|
139
|
+
self.error_code = nil
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'message')
|
|
143
|
+
self.message = attributes[:'message']
|
|
144
|
+
else
|
|
145
|
+
self.message = nil
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'status_code')
|
|
149
|
+
self.status_code = attributes[:'status_code']
|
|
150
|
+
else
|
|
151
|
+
self.status_code = nil
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'request_id')
|
|
155
|
+
self.request_id = attributes[:'request_id']
|
|
156
|
+
else
|
|
157
|
+
self.request_id = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'details')
|
|
161
|
+
if (value = attributes[:'details']).is_a?(Array)
|
|
162
|
+
self.details = value
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'retry_after_seconds')
|
|
167
|
+
self.retry_after_seconds = attributes[:'retry_after_seconds']
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
172
|
+
# @return Array for valid properties with the reasons
|
|
173
|
+
def list_invalid_properties
|
|
174
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
175
|
+
invalid_properties = Array.new
|
|
176
|
+
if @status.nil?
|
|
177
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if @error.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if @error_code.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "error_code", error_code cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @message.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @status_code.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "status_code", status_code cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @request_id.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
invalid_properties
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Check to see if the all the properties in the model are valid
|
|
204
|
+
# @return true if the model is valid
|
|
205
|
+
def valid?
|
|
206
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
207
|
+
return false if @status.nil?
|
|
208
|
+
status_validator = EnumAttributeValidator.new('String', ["ERROR"])
|
|
209
|
+
return false unless status_validator.valid?(@status)
|
|
210
|
+
return false if @error.nil?
|
|
211
|
+
return false if @error_code.nil?
|
|
212
|
+
return false if @message.nil?
|
|
213
|
+
return false if @status_code.nil?
|
|
214
|
+
return false if @request_id.nil?
|
|
215
|
+
true
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] error Value to be assigned
|
|
220
|
+
def error=(error)
|
|
221
|
+
if error.nil?
|
|
222
|
+
fail ArgumentError, 'error cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@error = error
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] error_code Value to be assigned
|
|
230
|
+
def error_code=(error_code)
|
|
231
|
+
if error_code.nil?
|
|
232
|
+
fail ArgumentError, 'error_code cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@error_code = error_code
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] message Value to be assigned
|
|
240
|
+
def message=(message)
|
|
241
|
+
if message.nil?
|
|
242
|
+
fail ArgumentError, 'message cannot be nil'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@message = message
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] status_code Value to be assigned
|
|
250
|
+
def status_code=(status_code)
|
|
251
|
+
if status_code.nil?
|
|
252
|
+
fail ArgumentError, 'status_code cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@status_code = status_code
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] request_id Value to be assigned
|
|
260
|
+
def request_id=(request_id)
|
|
261
|
+
if request_id.nil?
|
|
262
|
+
fail ArgumentError, 'request_id cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@request_id = request_id
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Checks equality by comparing each attribute.
|
|
269
|
+
# @param [Object] Object to be compared
|
|
270
|
+
def ==(o)
|
|
271
|
+
return true if self.equal?(o)
|
|
272
|
+
self.class == o.class &&
|
|
273
|
+
status == o.status &&
|
|
274
|
+
error == o.error &&
|
|
275
|
+
error_code == o.error_code &&
|
|
276
|
+
message == o.message &&
|
|
277
|
+
status_code == o.status_code &&
|
|
278
|
+
request_id == o.request_id &&
|
|
279
|
+
details == o.details &&
|
|
280
|
+
retry_after_seconds == o.retry_after_seconds
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# @see the `==` method
|
|
284
|
+
# @param [Object] Object to be compared
|
|
285
|
+
def eql?(o)
|
|
286
|
+
self == o
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Calculates hash code according to all attributes.
|
|
290
|
+
# @return [Integer] Hash code
|
|
291
|
+
def hash
|
|
292
|
+
[status, error, error_code, message, status_code, request_id, details, retry_after_seconds].hash
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Builds the object from hash
|
|
296
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
297
|
+
# @return [Object] Returns the model itself
|
|
298
|
+
def self.build_from_hash(attributes)
|
|
299
|
+
return nil unless attributes.is_a?(Hash)
|
|
300
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
301
|
+
transformed_hash = {}
|
|
302
|
+
openapi_types.each_pair do |key, type|
|
|
303
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
304
|
+
transformed_hash["#{key}"] = nil
|
|
305
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
306
|
+
# check to ensure the input is an array given that the attribute
|
|
307
|
+
# is documented as an array but the input is not
|
|
308
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
309
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
310
|
+
end
|
|
311
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
312
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
new(transformed_hash)
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Returns the object in the form of hash
|
|
319
|
+
# @return [Hash] Returns the object in the form of hash
|
|
320
|
+
def to_hash
|
|
321
|
+
hash = {}
|
|
322
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
323
|
+
value = self.send(attr)
|
|
324
|
+
if value.nil?
|
|
325
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
326
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
hash[param] = _to_hash(value)
|
|
330
|
+
end
|
|
331
|
+
hash
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
end
|