up_banking 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +219 -0
- data/Rakefile +10 -0
- data/config.json +11 -0
- data/docs/AccountResource.md +26 -0
- data/docs/AccountResourceAttributes.md +26 -0
- data/docs/AccountResourceAttributesBalance.md +22 -0
- data/docs/AccountResourceLinks.md +18 -0
- data/docs/AccountResourceRelationships.md +18 -0
- data/docs/AccountResourceRelationshipsTransactions.md +18 -0
- data/docs/AccountResourceRelationshipsTransactionsLinks.md +18 -0
- data/docs/AccountTypeEnum.md +15 -0
- data/docs/AccountsApi.md +153 -0
- data/docs/CashbackObject.md +20 -0
- data/docs/CashbackObjectAmount.md +22 -0
- data/docs/CategoriesApi.md +222 -0
- data/docs/CategoryInputResourceIdentifier.md +20 -0
- data/docs/CategoryResource.md +26 -0
- data/docs/CategoryResourceAttributes.md +18 -0
- data/docs/CategoryResourceRelationships.md +20 -0
- data/docs/CategoryResourceRelationshipsChildren.md +20 -0
- data/docs/CategoryResourceRelationshipsChildrenDataInner.md +20 -0
- data/docs/CategoryResourceRelationshipsParent.md +20 -0
- data/docs/CategoryResourceRelationshipsParentData.md +20 -0
- data/docs/CreateWebhookRequest.md +18 -0
- data/docs/CreateWebhookRequestData.md +18 -0
- data/docs/CreateWebhookResponse.md +18 -0
- data/docs/CreateWebhookResponseData.md +26 -0
- data/docs/ErrorObject.md +24 -0
- data/docs/ErrorObjectSource.md +20 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/GetAccountResponse.md +18 -0
- data/docs/GetAccountResponseData.md +26 -0
- data/docs/GetCategoryResponse.md +18 -0
- data/docs/GetCategoryResponseData.md +26 -0
- data/docs/GetTransactionResponse.md +18 -0
- data/docs/GetTransactionResponseData.md +26 -0
- data/docs/GetWebhookResponse.md +18 -0
- data/docs/GetWebhookResponseData.md +26 -0
- data/docs/HoldInfoObject.md +20 -0
- data/docs/HoldInfoObjectAmount.md +22 -0
- data/docs/HoldInfoObjectForeignAmount.md +22 -0
- data/docs/ListAccountsResponse.md +20 -0
- data/docs/ListAccountsResponseLinks.md +20 -0
- data/docs/ListCategoriesResponse.md +18 -0
- data/docs/ListTagsResponse.md +20 -0
- data/docs/ListTransactionsResponse.md +20 -0
- data/docs/ListWebhookDeliveryLogsResponse.md +20 -0
- data/docs/ListWebhooksResponse.md +20 -0
- data/docs/MoneyObject.md +22 -0
- data/docs/OwnershipTypeEnum.md +15 -0
- data/docs/PingResponse.md +18 -0
- data/docs/PingResponseMeta.md +20 -0
- data/docs/RoundUpObject.md +20 -0
- data/docs/RoundUpObjectAmount.md +22 -0
- data/docs/RoundUpObjectBoostPortion.md +22 -0
- data/docs/TagInputResourceIdentifier.md +20 -0
- data/docs/TagResource.md +22 -0
- data/docs/TagsApi.md +225 -0
- data/docs/TransactionResource.md +26 -0
- data/docs/TransactionResourceAttributes.md +40 -0
- data/docs/TransactionResourceAttributesAmount.md +22 -0
- data/docs/TransactionResourceAttributesCashback.md +20 -0
- data/docs/TransactionResourceAttributesForeignAmount.md +22 -0
- data/docs/TransactionResourceAttributesHoldInfo.md +20 -0
- data/docs/TransactionResourceAttributesRoundUp.md +20 -0
- data/docs/TransactionResourceRelationships.md +26 -0
- data/docs/TransactionResourceRelationshipsAccount.md +20 -0
- data/docs/TransactionResourceRelationshipsAccountData.md +20 -0
- data/docs/TransactionResourceRelationshipsCategory.md +20 -0
- data/docs/TransactionResourceRelationshipsCategoryLinks.md +20 -0
- data/docs/TransactionResourceRelationshipsTags.md +20 -0
- data/docs/TransactionResourceRelationshipsTagsDataInner.md +20 -0
- data/docs/TransactionResourceRelationshipsTagsLinks.md +18 -0
- data/docs/TransactionResourceRelationshipsTransferAccount.md +20 -0
- data/docs/TransactionResourceRelationshipsTransferAccountData.md +20 -0
- data/docs/TransactionStatusEnum.md +15 -0
- data/docs/TransactionsApi.md +243 -0
- data/docs/UpdateTransactionCategoryRequest.md +18 -0
- data/docs/UpdateTransactionCategoryRequestData.md +20 -0
- data/docs/UpdateTransactionTagsRequest.md +18 -0
- data/docs/UtilityEndpointsApi.md +74 -0
- data/docs/WebhookDeliveryLogResource.md +24 -0
- data/docs/WebhookDeliveryLogResourceAttributes.md +24 -0
- data/docs/WebhookDeliveryLogResourceAttributesRequest.md +18 -0
- data/docs/WebhookDeliveryLogResourceAttributesResponse.md +20 -0
- data/docs/WebhookDeliveryLogResourceRelationships.md +18 -0
- data/docs/WebhookDeliveryLogResourceRelationshipsWebhookEvent.md +18 -0
- data/docs/WebhookDeliveryLogResourceRelationshipsWebhookEventData.md +20 -0
- data/docs/WebhookDeliveryStatusEnum.md +15 -0
- data/docs/WebhookEventCallback.md +18 -0
- data/docs/WebhookEventCallbackData.md +24 -0
- data/docs/WebhookEventResource.md +24 -0
- data/docs/WebhookEventResourceAttributes.md +20 -0
- data/docs/WebhookEventResourceRelationships.md +20 -0
- data/docs/WebhookEventResourceRelationshipsTransaction.md +20 -0
- data/docs/WebhookEventResourceRelationshipsTransactionData.md +20 -0
- data/docs/WebhookEventResourceRelationshipsWebhook.md +20 -0
- data/docs/WebhookEventResourceRelationshipsWebhookData.md +20 -0
- data/docs/WebhookEventTypeEnum.md +15 -0
- data/docs/WebhookInputResource.md +18 -0
- data/docs/WebhookInputResourceAttributes.md +20 -0
- data/docs/WebhookResource.md +26 -0
- data/docs/WebhookResourceAttributes.md +24 -0
- data/docs/WebhookResourceRelationships.md +18 -0
- data/docs/WebhooksApi.md +434 -0
- data/git_push.sh +57 -0
- data/lib/.DS_Store +0 -0
- data/lib/up_banking/.DS_Store +0 -0
- data/lib/up_banking/api/accounts_api.rb +151 -0
- data/lib/up_banking/api/categories_api.rb +213 -0
- data/lib/up_banking/api/tags_api.rb +218 -0
- data/lib/up_banking/api/transactions_api.rb +241 -0
- data/lib/up_banking/api/utility_endpoints_api.rb +79 -0
- data/lib/up_banking/api/webhooks_api.rb +399 -0
- data/lib/up_banking/api_client.rb +392 -0
- data/lib/up_banking/api_error.rb +57 -0
- data/lib/up_banking/configuration.rb +279 -0
- data/lib/up_banking/models/account_resource.rb +278 -0
- data/lib/up_banking/models/account_resource_attributes.rb +284 -0
- data/lib/up_banking/models/account_resource_attributes_balance.rb +263 -0
- data/lib/up_banking/models/account_resource_links.rb +225 -0
- data/lib/up_banking/models/account_resource_relationships.rb +224 -0
- data/lib/up_banking/models/account_resource_relationships_transactions.rb +219 -0
- data/lib/up_banking/models/account_resource_relationships_transactions_links.rb +225 -0
- data/lib/up_banking/models/account_type_enum.rb +40 -0
- data/lib/up_banking/models/cashback_object.rb +240 -0
- data/lib/up_banking/models/cashback_object_amount.rb +263 -0
- data/lib/up_banking/models/category_input_resource_identifier.rb +241 -0
- data/lib/up_banking/models/category_resource.rb +278 -0
- data/lib/up_banking/models/category_resource_attributes.rb +225 -0
- data/lib/up_banking/models/category_resource_relationships.rb +238 -0
- data/lib/up_banking/models/category_resource_relationships_children.rb +235 -0
- data/lib/up_banking/models/category_resource_relationships_children_data_inner.rb +240 -0
- data/lib/up_banking/models/category_resource_relationships_parent.rb +229 -0
- data/lib/up_banking/models/category_resource_relationships_parent_data.rb +240 -0
- data/lib/up_banking/models/create_webhook_request.rb +225 -0
- data/lib/up_banking/models/create_webhook_request_data.rb +232 -0
- data/lib/up_banking/models/create_webhook_response.rb +225 -0
- data/lib/up_banking/models/create_webhook_response_data.rb +285 -0
- data/lib/up_banking/models/error_object.rb +265 -0
- data/lib/up_banking/models/error_object_source.rb +231 -0
- data/lib/up_banking/models/error_response.rb +228 -0
- data/lib/up_banking/models/get_account_response.rb +225 -0
- data/lib/up_banking/models/get_account_response_data.rb +285 -0
- data/lib/up_banking/models/get_category_response.rb +225 -0
- data/lib/up_banking/models/get_category_response_data.rb +285 -0
- data/lib/up_banking/models/get_transaction_response.rb +225 -0
- data/lib/up_banking/models/get_transaction_response_data.rb +285 -0
- data/lib/up_banking/models/get_webhook_response.rb +225 -0
- data/lib/up_banking/models/get_webhook_response_data.rb +285 -0
- data/lib/up_banking/models/hold_info_object.rb +235 -0
- data/lib/up_banking/models/hold_info_object_amount.rb +263 -0
- data/lib/up_banking/models/hold_info_object_foreign_amount.rb +263 -0
- data/lib/up_banking/models/list_accounts_response.rb +242 -0
- data/lib/up_banking/models/list_accounts_response_links.rb +232 -0
- data/lib/up_banking/models/list_categories_response.rb +228 -0
- data/lib/up_banking/models/list_tags_response.rb +242 -0
- data/lib/up_banking/models/list_transactions_response.rb +242 -0
- data/lib/up_banking/models/list_webhook_delivery_logs_response.rb +242 -0
- data/lib/up_banking/models/list_webhooks_response.rb +242 -0
- data/lib/up_banking/models/money_object.rb +256 -0
- data/lib/up_banking/models/ownership_type_enum.rb +40 -0
- data/lib/up_banking/models/ping_response.rb +225 -0
- data/lib/up_banking/models/ping_response_meta.rb +240 -0
- data/lib/up_banking/models/round_up_object.rb +235 -0
- data/lib/up_banking/models/round_up_object_amount.rb +263 -0
- data/lib/up_banking/models/round_up_object_boost_portion.rb +263 -0
- data/lib/up_banking/models/tag_input_resource_identifier.rb +241 -0
- data/lib/up_banking/models/tag_resource.rb +255 -0
- data/lib/up_banking/models/transaction_resource.rb +277 -0
- data/lib/up_banking/models/transaction_resource_attributes.rb +357 -0
- data/lib/up_banking/models/transaction_resource_attributes_amount.rb +263 -0
- data/lib/up_banking/models/transaction_resource_attributes_cashback.rb +247 -0
- data/lib/up_banking/models/transaction_resource_attributes_foreign_amount.rb +263 -0
- data/lib/up_banking/models/transaction_resource_attributes_hold_info.rb +242 -0
- data/lib/up_banking/models/transaction_resource_attributes_round_up.rb +242 -0
- data/lib/up_banking/models/transaction_resource_relationships.rb +280 -0
- data/lib/up_banking/models/transaction_resource_relationships_account.rb +233 -0
- data/lib/up_banking/models/transaction_resource_relationships_account_data.rb +240 -0
- data/lib/up_banking/models/transaction_resource_relationships_category.rb +229 -0
- data/lib/up_banking/models/transaction_resource_relationships_category_links.rb +235 -0
- data/lib/up_banking/models/transaction_resource_relationships_tags.rb +235 -0
- data/lib/up_banking/models/transaction_resource_relationships_tags_data_inner.rb +240 -0
- data/lib/up_banking/models/transaction_resource_relationships_tags_links.rb +225 -0
- data/lib/up_banking/models/transaction_resource_relationships_transfer_account.rb +230 -0
- data/lib/up_banking/models/transaction_resource_relationships_transfer_account_data.rb +240 -0
- data/lib/up_banking/models/transaction_status_enum.rb +40 -0
- data/lib/up_banking/models/update_transaction_category_request.rb +221 -0
- data/lib/up_banking/models/update_transaction_category_request_data.rb +248 -0
- data/lib/up_banking/models/update_transaction_tags_request.rb +228 -0
- data/lib/up_banking/models/webhook_delivery_log_resource.rb +269 -0
- data/lib/up_banking/models/webhook_delivery_log_resource_attributes.rb +264 -0
- data/lib/up_banking/models/webhook_delivery_log_resource_attributes_request.rb +226 -0
- data/lib/up_banking/models/webhook_delivery_log_resource_attributes_response.rb +241 -0
- data/lib/up_banking/models/webhook_delivery_log_resource_relationships.rb +224 -0
- data/lib/up_banking/models/webhook_delivery_log_resource_relationships_webhook_event.rb +224 -0
- data/lib/up_banking/models/webhook_delivery_log_resource_relationships_webhook_event_data.rb +240 -0
- data/lib/up_banking/models/webhook_delivery_status_enum.rb +41 -0
- data/lib/up_banking/models/webhook_event_callback.rb +225 -0
- data/lib/up_banking/models/webhook_event_callback_data.rb +276 -0
- data/lib/up_banking/models/webhook_event_resource.rb +269 -0
- data/lib/up_banking/models/webhook_event_resource_attributes.rb +240 -0
- data/lib/up_banking/models/webhook_event_resource_relationships.rb +233 -0
- data/lib/up_banking/models/webhook_event_resource_relationships_transaction.rb +233 -0
- data/lib/up_banking/models/webhook_event_resource_relationships_transaction_data.rb +240 -0
- data/lib/up_banking/models/webhook_event_resource_relationships_webhook.rb +233 -0
- data/lib/up_banking/models/webhook_event_resource_relationships_webhook_data.rb +240 -0
- data/lib/up_banking/models/webhook_event_type_enum.rb +42 -0
- data/lib/up_banking/models/webhook_input_resource.rb +225 -0
- data/lib/up_banking/models/webhook_input_resource_attributes.rb +236 -0
- data/lib/up_banking/models/webhook_resource.rb +278 -0
- data/lib/up_banking/models/webhook_resource_attributes.rb +261 -0
- data/lib/up_banking/models/webhook_resource_relationships.rb +224 -0
- data/lib/up_banking/version.rb +15 -0
- data/lib/up_banking.rb +141 -0
- data/spec/.DS_Store +0 -0
- data/spec/api/accounts_api_spec.rb +61 -0
- data/spec/api/categories_api_spec.rb +72 -0
- data/spec/api/tags_api_spec.rb +73 -0
- data/spec/api/transactions_api_spec.rb +82 -0
- data/spec/api/utility_endpoints_api_spec.rb +46 -0
- data/spec/api/webhooks_api_spec.rb +108 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_resource_attributes_balance_spec.rb +46 -0
- data/spec/models/account_resource_attributes_spec.rb +58 -0
- data/spec/models/account_resource_links_spec.rb +34 -0
- data/spec/models/account_resource_relationships_spec.rb +34 -0
- data/spec/models/account_resource_relationships_transactions_links_spec.rb +34 -0
- data/spec/models/account_resource_relationships_transactions_spec.rb +34 -0
- data/spec/models/account_resource_spec.rb +58 -0
- data/spec/models/account_type_enum_spec.rb +28 -0
- data/spec/models/cashback_object_amount_spec.rb +46 -0
- data/spec/models/cashback_object_spec.rb +40 -0
- data/spec/models/category_input_resource_identifier_spec.rb +40 -0
- data/spec/models/category_resource_attributes_spec.rb +34 -0
- data/spec/models/category_resource_relationships_children_data_inner_spec.rb +40 -0
- data/spec/models/category_resource_relationships_children_spec.rb +40 -0
- data/spec/models/category_resource_relationships_parent_data_spec.rb +40 -0
- data/spec/models/category_resource_relationships_parent_spec.rb +40 -0
- data/spec/models/category_resource_relationships_spec.rb +40 -0
- data/spec/models/category_resource_spec.rb +58 -0
- data/spec/models/create_webhook_request_data_spec.rb +34 -0
- data/spec/models/create_webhook_request_spec.rb +34 -0
- data/spec/models/create_webhook_response_data_spec.rb +58 -0
- data/spec/models/create_webhook_response_spec.rb +34 -0
- data/spec/models/error_object_source_spec.rb +40 -0
- data/spec/models/error_object_spec.rb +52 -0
- data/spec/models/error_response_spec.rb +34 -0
- data/spec/models/get_account_response_data_spec.rb +58 -0
- data/spec/models/get_account_response_spec.rb +34 -0
- data/spec/models/get_category_response_data_spec.rb +58 -0
- data/spec/models/get_category_response_spec.rb +34 -0
- data/spec/models/get_transaction_response_data_spec.rb +58 -0
- data/spec/models/get_transaction_response_spec.rb +34 -0
- data/spec/models/get_webhook_response_data_spec.rb +58 -0
- data/spec/models/get_webhook_response_spec.rb +34 -0
- data/spec/models/hold_info_object_amount_spec.rb +46 -0
- data/spec/models/hold_info_object_foreign_amount_spec.rb +46 -0
- data/spec/models/hold_info_object_spec.rb +40 -0
- data/spec/models/list_accounts_response_links_spec.rb +40 -0
- data/spec/models/list_accounts_response_spec.rb +40 -0
- data/spec/models/list_categories_response_spec.rb +34 -0
- data/spec/models/list_tags_response_spec.rb +40 -0
- data/spec/models/list_transactions_response_spec.rb +40 -0
- data/spec/models/list_webhook_delivery_logs_response_spec.rb +40 -0
- data/spec/models/list_webhooks_response_spec.rb +40 -0
- data/spec/models/money_object_spec.rb +46 -0
- data/spec/models/ownership_type_enum_spec.rb +28 -0
- data/spec/models/ping_response_meta_spec.rb +40 -0
- data/spec/models/ping_response_spec.rb +34 -0
- data/spec/models/round_up_object_amount_spec.rb +46 -0
- data/spec/models/round_up_object_boost_portion_spec.rb +46 -0
- data/spec/models/round_up_object_spec.rb +40 -0
- data/spec/models/tag_input_resource_identifier_spec.rb +40 -0
- data/spec/models/tag_resource_spec.rb +46 -0
- data/spec/models/transaction_resource_attributes_amount_spec.rb +46 -0
- data/spec/models/transaction_resource_attributes_cashback_spec.rb +40 -0
- data/spec/models/transaction_resource_attributes_foreign_amount_spec.rb +46 -0
- data/spec/models/transaction_resource_attributes_hold_info_spec.rb +40 -0
- data/spec/models/transaction_resource_attributes_round_up_spec.rb +40 -0
- data/spec/models/transaction_resource_attributes_spec.rb +100 -0
- data/spec/models/transaction_resource_relationships_account_data_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_account_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_category_links_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_category_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_spec.rb +58 -0
- data/spec/models/transaction_resource_relationships_tags_data_inner_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_tags_links_spec.rb +34 -0
- data/spec/models/transaction_resource_relationships_tags_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_transfer_account_data_spec.rb +40 -0
- data/spec/models/transaction_resource_relationships_transfer_account_spec.rb +40 -0
- data/spec/models/transaction_resource_spec.rb +58 -0
- data/spec/models/transaction_status_enum_spec.rb +28 -0
- data/spec/models/update_transaction_category_request_data_spec.rb +40 -0
- data/spec/models/update_transaction_category_request_spec.rb +34 -0
- data/spec/models/update_transaction_tags_request_spec.rb +34 -0
- data/spec/models/webhook_delivery_log_resource_attributes_request_spec.rb +34 -0
- data/spec/models/webhook_delivery_log_resource_attributes_response_spec.rb +40 -0
- data/spec/models/webhook_delivery_log_resource_attributes_spec.rb +52 -0
- data/spec/models/webhook_delivery_log_resource_relationships_spec.rb +34 -0
- data/spec/models/webhook_delivery_log_resource_relationships_webhook_event_data_spec.rb +40 -0
- data/spec/models/webhook_delivery_log_resource_relationships_webhook_event_spec.rb +34 -0
- data/spec/models/webhook_delivery_log_resource_spec.rb +52 -0
- data/spec/models/webhook_delivery_status_enum_spec.rb +28 -0
- data/spec/models/webhook_event_callback_data_spec.rb +52 -0
- data/spec/models/webhook_event_callback_spec.rb +34 -0
- data/spec/models/webhook_event_resource_attributes_spec.rb +40 -0
- data/spec/models/webhook_event_resource_relationships_spec.rb +40 -0
- data/spec/models/webhook_event_resource_relationships_transaction_data_spec.rb +40 -0
- data/spec/models/webhook_event_resource_relationships_transaction_spec.rb +40 -0
- data/spec/models/webhook_event_resource_relationships_webhook_data_spec.rb +40 -0
- data/spec/models/webhook_event_resource_relationships_webhook_spec.rb +40 -0
- data/spec/models/webhook_event_resource_spec.rb +52 -0
- data/spec/models/webhook_event_type_enum_spec.rb +28 -0
- data/spec/models/webhook_input_resource_attributes_spec.rb +40 -0
- data/spec/models/webhook_input_resource_spec.rb +34 -0
- data/spec/models/webhook_resource_attributes_spec.rb +52 -0
- data/spec/models/webhook_resource_relationships_spec.rb +34 -0
- data/spec/models/webhook_resource_spec.rb +58 -0
- data/spec/spec_helper.rb +111 -0
- data/up_banking.gemspec +38 -0
- metadata +511 -0
@@ -0,0 +1,238 @@
|
|
1
|
+
=begin
|
2
|
+
#Up API
|
3
|
+
|
4
|
+
#The Up API gives you programmatic access to your balances and transaction data. You can request past transactions or set up webhooks to receive real-time events when new transactions hit your account. It’s new, it’s exciting and it’s just the beginning.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module UpBankingClient
|
17
|
+
class CategoryResourceRelationships
|
18
|
+
attr_accessor :parent
|
19
|
+
|
20
|
+
attr_accessor :children
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'parent' => :'parent',
|
26
|
+
:'children' => :'children'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'parent' => :'CategoryResourceRelationshipsParent',
|
39
|
+
:'children' => :'CategoryResourceRelationshipsChildren'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UpBankingClient::CategoryResourceRelationships` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UpBankingClient::CategoryResourceRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'parent')
|
65
|
+
self.parent = attributes[:'parent']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'children')
|
69
|
+
self.children = attributes[:'children']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
if @parent.nil?
|
78
|
+
invalid_properties.push('invalid value for "parent", parent cannot be nil.')
|
79
|
+
end
|
80
|
+
|
81
|
+
if @children.nil?
|
82
|
+
invalid_properties.push('invalid value for "children", children cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
return false if @parent.nil?
|
92
|
+
return false if @children.nil?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
parent == o.parent &&
|
102
|
+
children == o.children
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
def hash
|
114
|
+
[parent, children].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def self.build_from_hash(attributes)
|
121
|
+
new.build_from_hash(attributes)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Builds the object from hash
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @return [Object] Returns the model itself
|
127
|
+
def build_from_hash(attributes)
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
130
|
+
self.class.openapi_types.each_pair do |key, type|
|
131
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
132
|
+
self.send("#{key}=", nil)
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :Time
|
154
|
+
Time.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :Boolean
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
# models (e.g. Pet) or oneOf
|
185
|
+
klass = UpBankingClient.const_get(type)
|
186
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
if value.nil?
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
+
end
|
212
|
+
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
@@ -0,0 +1,235 @@
|
|
1
|
+
=begin
|
2
|
+
#Up API
|
3
|
+
|
4
|
+
#The Up API gives you programmatic access to your balances and transaction data. You can request past transactions or set up webhooks to receive real-time events when new transactions hit your account. It’s new, it’s exciting and it’s just the beginning.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module UpBankingClient
|
17
|
+
class CategoryResourceRelationshipsChildren
|
18
|
+
attr_accessor :data
|
19
|
+
|
20
|
+
attr_accessor :links
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'data' => :'data',
|
26
|
+
:'links' => :'links'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'data' => :'Array<CategoryResourceRelationshipsChildrenDataInner>',
|
39
|
+
:'links' => :'AccountResourceRelationshipsTransactionsLinks'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UpBankingClient::CategoryResourceRelationshipsChildren` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UpBankingClient::CategoryResourceRelationshipsChildren`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'data')
|
65
|
+
if (value = attributes[:'data']).is_a?(Array)
|
66
|
+
self.data = value
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'links')
|
71
|
+
self.links = attributes[:'links']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if @data.nil?
|
80
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
return false if @data.nil?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
data == o.data &&
|
99
|
+
links == o.links
|
100
|
+
end
|
101
|
+
|
102
|
+
# @see the `==` method
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def eql?(o)
|
105
|
+
self == o
|
106
|
+
end
|
107
|
+
|
108
|
+
# Calculates hash code according to all attributes.
|
109
|
+
# @return [Integer] Hash code
|
110
|
+
def hash
|
111
|
+
[data, links].hash
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def self.build_from_hash(attributes)
|
118
|
+
new.build_from_hash(attributes)
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
attributes = attributes.transform_keys(&:to_sym)
|
127
|
+
self.class.openapi_types.each_pair do |key, type|
|
128
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
129
|
+
self.send("#{key}=", nil)
|
130
|
+
elsif type =~ /\AArray<(.*)>/i
|
131
|
+
# check to ensure the input is an array given that the attribute
|
132
|
+
# is documented as an array but the input is not
|
133
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
134
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
135
|
+
end
|
136
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
137
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
self
|
142
|
+
end
|
143
|
+
|
144
|
+
# Deserializes the data based on type
|
145
|
+
# @param string type Data type
|
146
|
+
# @param string value Value to be deserialized
|
147
|
+
# @return [Object] Deserialized data
|
148
|
+
def _deserialize(type, value)
|
149
|
+
case type.to_sym
|
150
|
+
when :Time
|
151
|
+
Time.parse(value)
|
152
|
+
when :Date
|
153
|
+
Date.parse(value)
|
154
|
+
when :String
|
155
|
+
value.to_s
|
156
|
+
when :Integer
|
157
|
+
value.to_i
|
158
|
+
when :Float
|
159
|
+
value.to_f
|
160
|
+
when :Boolean
|
161
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
162
|
+
true
|
163
|
+
else
|
164
|
+
false
|
165
|
+
end
|
166
|
+
when :Object
|
167
|
+
# generic object (usually a Hash), return directly
|
168
|
+
value
|
169
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
170
|
+
inner_type = Regexp.last_match[:inner_type]
|
171
|
+
value.map { |v| _deserialize(inner_type, v) }
|
172
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
173
|
+
k_type = Regexp.last_match[:k_type]
|
174
|
+
v_type = Regexp.last_match[:v_type]
|
175
|
+
{}.tap do |hash|
|
176
|
+
value.each do |k, v|
|
177
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
else # model
|
181
|
+
# models (e.g. Pet) or oneOf
|
182
|
+
klass = UpBankingClient.const_get(type)
|
183
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the string representation of the object
|
188
|
+
# @return [String] String presentation of the object
|
189
|
+
def to_s
|
190
|
+
to_hash.to_s
|
191
|
+
end
|
192
|
+
|
193
|
+
# to_body is an alias to to_hash (backward compatibility)
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_body
|
196
|
+
to_hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns the object in the form of hash
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_hash
|
202
|
+
hash = {}
|
203
|
+
self.class.attribute_map.each_pair do |attr, param|
|
204
|
+
value = self.send(attr)
|
205
|
+
if value.nil?
|
206
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
207
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
208
|
+
end
|
209
|
+
|
210
|
+
hash[param] = _to_hash(value)
|
211
|
+
end
|
212
|
+
hash
|
213
|
+
end
|
214
|
+
|
215
|
+
# Outputs non-array value in the form of hash
|
216
|
+
# For object, use to_hash. Otherwise, just return the value
|
217
|
+
# @param [Object] value Any valid value
|
218
|
+
# @return [Hash] Returns the value in the form of hash
|
219
|
+
def _to_hash(value)
|
220
|
+
if value.is_a?(Array)
|
221
|
+
value.compact.map { |v| _to_hash(v) }
|
222
|
+
elsif value.is_a?(Hash)
|
223
|
+
{}.tap do |hash|
|
224
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
225
|
+
end
|
226
|
+
elsif value.respond_to? :to_hash
|
227
|
+
value.to_hash
|
228
|
+
else
|
229
|
+
value
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
@@ -0,0 +1,240 @@
|
|
1
|
+
=begin
|
2
|
+
#Up API
|
3
|
+
|
4
|
+
#The Up API gives you programmatic access to your balances and transaction data. You can request past transactions or set up webhooks to receive real-time events when new transactions hit your account. It’s new, it’s exciting and it’s just the beginning.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module UpBankingClient
|
17
|
+
class CategoryResourceRelationshipsChildrenDataInner
|
18
|
+
# The type of this resource: `categories`
|
19
|
+
attr_accessor :type
|
20
|
+
|
21
|
+
# The unique identifier of the resource within its type.
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'type' => :'type',
|
28
|
+
:'id' => :'id'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'type' => :'String',
|
41
|
+
:'id' => :'String'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UpBankingClient::CategoryResourceRelationshipsChildrenDataInner` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UpBankingClient::CategoryResourceRelationshipsChildrenDataInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'type')
|
67
|
+
self.type = attributes[:'type']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'id')
|
71
|
+
self.id = attributes[:'id']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if @type.nil?
|
80
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
if @id.nil?
|
84
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
85
|
+
end
|
86
|
+
|
87
|
+
invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
return false if @type.nil?
|
94
|
+
return false if @id.nil?
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
type == o.type &&
|
104
|
+
id == o.id
|
105
|
+
end
|
106
|
+
|
107
|
+
# @see the `==` method
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def eql?(o)
|
110
|
+
self == o
|
111
|
+
end
|
112
|
+
|
113
|
+
# Calculates hash code according to all attributes.
|
114
|
+
# @return [Integer] Hash code
|
115
|
+
def hash
|
116
|
+
[type, id].hash
|
117
|
+
end
|
118
|
+
|
119
|
+
# Builds the object from hash
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
+
# @return [Object] Returns the model itself
|
122
|
+
def self.build_from_hash(attributes)
|
123
|
+
new.build_from_hash(attributes)
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def build_from_hash(attributes)
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
132
|
+
self.class.openapi_types.each_pair do |key, type|
|
133
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
134
|
+
self.send("#{key}=", nil)
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
136
|
+
# check to ensure the input is an array given that the attribute
|
137
|
+
# is documented as an array but the input is not
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
140
|
+
end
|
141
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
self
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def _deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :Boolean
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = UpBankingClient.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
# @return [String] String presentation of the object
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_body
|
201
|
+
to_hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the object in the form of hash
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_hash
|
207
|
+
hash = {}
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
209
|
+
value = self.send(attr)
|
210
|
+
if value.nil?
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
213
|
+
end
|
214
|
+
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|