xero-ruby 0.1.1
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/Gemfile.lock +79 -0
- data/README.md +454 -0
- data/Rakefile +10 -0
- data/docs/Account.md +53 -0
- data/docs/AccountType.md +16 -0
- data/docs/AccountingApi.md +11269 -0
- data/docs/Accounts.md +17 -0
- data/docs/AccountsPayable.md +19 -0
- data/docs/AccountsReceivable.md +19 -0
- data/docs/Address.md +35 -0
- data/docs/Allocation.md +21 -0
- data/docs/Allocations.md +17 -0
- data/docs/Attachment.md +27 -0
- data/docs/Attachments.md +17 -0
- data/docs/Balances.md +19 -0
- data/docs/BankTransaction.md +59 -0
- data/docs/BankTransactions.md +17 -0
- data/docs/BankTransfer.md +37 -0
- data/docs/BankTransfers.md +17 -0
- data/docs/BatchPayment.md +47 -0
- data/docs/BatchPaymentDetails.md +25 -0
- data/docs/BatchPayments.md +17 -0
- data/docs/Bill.md +19 -0
- data/docs/BrandingTheme.md +23 -0
- data/docs/BrandingThemes.md +17 -0
- data/docs/CISOrgSetting.md +21 -0
- data/docs/CISSetting.md +19 -0
- data/docs/CISSettings.md +17 -0
- data/docs/Contact.md +91 -0
- data/docs/ContactGroup.md +23 -0
- data/docs/ContactGroups.md +17 -0
- data/docs/ContactPerson.md +23 -0
- data/docs/Contacts.md +17 -0
- data/docs/CountryCode.md +16 -0
- data/docs/CreditNote.md +61 -0
- data/docs/CreditNotes.md +17 -0
- data/docs/Currencies.md +17 -0
- data/docs/Currency.md +19 -0
- data/docs/CurrencyCode.md +16 -0
- data/docs/Element.md +17 -0
- data/docs/Employee.md +27 -0
- data/docs/Employees.md +17 -0
- data/docs/Error.md +23 -0
- data/docs/ExpenseClaim.md +39 -0
- data/docs/ExpenseClaims.md +17 -0
- data/docs/ExternalLink.md +21 -0
- data/docs/HistoryRecord.md +23 -0
- data/docs/HistoryRecords.md +17 -0
- data/docs/Invoice.md +89 -0
- data/docs/InvoiceReminder.md +17 -0
- data/docs/InvoiceReminders.md +17 -0
- data/docs/Invoices.md +17 -0
- data/docs/Item.md +45 -0
- data/docs/Items.md +17 -0
- data/docs/Journal.md +31 -0
- data/docs/JournalLine.md +39 -0
- data/docs/Journals.md +17 -0
- data/docs/LineAmountTypes.md +16 -0
- data/docs/LineItem.md +41 -0
- data/docs/LineItemTracking.md +21 -0
- data/docs/LinkedTransaction.md +37 -0
- data/docs/LinkedTransactions.md +17 -0
- data/docs/ManualJournal.md +41 -0
- data/docs/ManualJournalLine.md +29 -0
- data/docs/ManualJournals.md +17 -0
- data/docs/OnlineInvoice.md +17 -0
- data/docs/OnlineInvoices.md +17 -0
- data/docs/Organisation.md +79 -0
- data/docs/Organisations.md +17 -0
- data/docs/Overpayment.md +51 -0
- data/docs/Overpayments.md +17 -0
- data/docs/Payment.md +61 -0
- data/docs/PaymentService.md +27 -0
- data/docs/PaymentServices.md +17 -0
- data/docs/PaymentTerm.md +19 -0
- data/docs/PaymentTermType.md +16 -0
- data/docs/Payments.md +17 -0
- data/docs/Phone.md +23 -0
- data/docs/Prepayment.md +49 -0
- data/docs/Prepayments.md +17 -0
- data/docs/Purchase.md +23 -0
- data/docs/PurchaseOrder.md +71 -0
- data/docs/PurchaseOrders.md +17 -0
- data/docs/Receipt.md +49 -0
- data/docs/Receipts.md +17 -0
- data/docs/RepeatingInvoice.md +47 -0
- data/docs/RepeatingInvoices.md +17 -0
- data/docs/Report.md +29 -0
- data/docs/ReportAttribute.md +19 -0
- data/docs/ReportCell.md +19 -0
- data/docs/ReportFields.md +21 -0
- data/docs/ReportRow.md +21 -0
- data/docs/ReportRows.md +23 -0
- data/docs/ReportWithRow.md +33 -0
- data/docs/ReportWithRows.md +17 -0
- data/docs/Reports.md +17 -0
- data/docs/RequestEmpty.md +17 -0
- data/docs/RowType.md +16 -0
- data/docs/SalesTrackingCategory.md +19 -0
- data/docs/Schedule.md +29 -0
- data/docs/TaxComponent.md +23 -0
- data/docs/TaxRate.md +39 -0
- data/docs/TaxRates.md +17 -0
- data/docs/TaxType.md +16 -0
- data/docs/TenNinteyNineContact.md +59 -0
- data/docs/TimeZone.md +16 -0
- data/docs/TrackingCategories.md +17 -0
- data/docs/TrackingCategory.md +27 -0
- data/docs/TrackingOption.md +23 -0
- data/docs/TrackingOptions.md +17 -0
- data/docs/User.md +29 -0
- data/docs/Users.md +17 -0
- data/docs/ValidationError.md +17 -0
- data/git_push.sh +55 -0
- data/lib/.DS_Store +0 -0
- data/lib/xero-ruby.rb +149 -0
- data/lib/xero-ruby/api/accounting_api.rb +14686 -0
- data/lib/xero-ruby/api_client.rb +386 -0
- data/lib/xero-ruby/api_error.rb +57 -0
- data/lib/xero-ruby/configuration.rb +252 -0
- data/lib/xero-ruby/models/account.rb +484 -0
- data/lib/xero-ruby/models/account_type.rb +57 -0
- data/lib/xero-ruby/models/accounts.rb +205 -0
- data/lib/xero-ruby/models/accounts_payable.rb +212 -0
- data/lib/xero-ruby/models/accounts_receivable.rb +212 -0
- data/lib/xero-ruby/models/address.rb +463 -0
- data/lib/xero-ruby/models/allocation.rb +238 -0
- data/lib/xero-ruby/models/allocations.rb +205 -0
- data/lib/xero-ruby/models/attachment.rb +254 -0
- data/lib/xero-ruby/models/attachments.rb +205 -0
- data/lib/xero-ruby/models/balances.rb +213 -0
- data/lib/xero-ruby/models/bank_transaction.rb +480 -0
- data/lib/xero-ruby/models/bank_transactions.rb +205 -0
- data/lib/xero-ruby/models/bank_transfer.rb +319 -0
- data/lib/xero-ruby/models/bank_transfers.rb +205 -0
- data/lib/xero-ruby/models/batch_payment.rb +429 -0
- data/lib/xero-ruby/models/batch_payment_details.rb +290 -0
- data/lib/xero-ruby/models/batch_payments.rb +205 -0
- data/lib/xero-ruby/models/bill.rb +213 -0
- data/lib/xero-ruby/models/branding_theme.rb +234 -0
- data/lib/xero-ruby/models/branding_themes.rb +205 -0
- data/lib/xero-ruby/models/cis_org_setting.rb +224 -0
- data/lib/xero-ruby/models/cis_setting.rb +214 -0
- data/lib/xero-ruby/models/cis_settings.rb +205 -0
- data/lib/xero-ruby/models/contact.rb +724 -0
- data/lib/xero-ruby/models/contact_group.rb +270 -0
- data/lib/xero-ruby/models/contact_groups.rb +205 -0
- data/lib/xero-ruby/models/contact_person.rb +234 -0
- data/lib/xero-ruby/models/contacts.rb +205 -0
- data/lib/xero-ruby/models/country_code.rb +275 -0
- data/lib/xero-ruby/models/credit_note.rb +475 -0
- data/lib/xero-ruby/models/credit_notes.rb +205 -0
- data/lib/xero-ruby/models/currencies.rb +205 -0
- data/lib/xero-ruby/models/currency.rb +213 -0
- data/lib/xero-ruby/models/currency_code.rb +197 -0
- data/lib/xero-ruby/models/element.rb +206 -0
- data/lib/xero-ruby/models/employee.rb +316 -0
- data/lib/xero-ruby/models/employees.rb +205 -0
- data/lib/xero-ruby/models/error.rb +236 -0
- data/lib/xero-ruby/models/expense_claim.rb +350 -0
- data/lib/xero-ruby/models/expense_claims.rb +205 -0
- data/lib/xero-ruby/models/external_link.rb +257 -0
- data/lib/xero-ruby/models/history_record.rb +234 -0
- data/lib/xero-ruby/models/history_records.rb +205 -0
- data/lib/xero-ruby/models/invoice.rb +666 -0
- data/lib/xero-ruby/models/invoice_reminder.rb +204 -0
- data/lib/xero-ruby/models/invoice_reminders.rb +205 -0
- data/lib/xero-ruby/models/invoices.rb +205 -0
- data/lib/xero-ruby/models/item.rb +418 -0
- data/lib/xero-ruby/models/items.rb +205 -0
- data/lib/xero-ruby/models/journal.rb +310 -0
- data/lib/xero-ruby/models/journal_line.rb +315 -0
- data/lib/xero-ruby/models/journals.rb +205 -0
- data/lib/xero-ruby/models/line_amount_types.rb +38 -0
- data/lib/xero-ruby/models/line_item.rb +326 -0
- data/lib/xero-ruby/models/line_item_tracking.rb +239 -0
- data/lib/xero-ruby/models/linked_transaction.rb +369 -0
- data/lib/xero-ruby/models/linked_transactions.rb +205 -0
- data/lib/xero-ruby/models/manual_journal.rb +375 -0
- data/lib/xero-ruby/models/manual_journal_line.rb +266 -0
- data/lib/xero-ruby/models/manual_journals.rb +205 -0
- data/lib/xero-ruby/models/online_invoice.rb +204 -0
- data/lib/xero-ruby/models/online_invoices.rb +205 -0
- data/lib/xero-ruby/models/organisation.rb +622 -0
- data/lib/xero-ruby/models/organisations.rb +205 -0
- data/lib/xero-ruby/models/overpayment.rb +425 -0
- data/lib/xero-ruby/models/overpayments.rb +205 -0
- data/lib/xero-ruby/models/payment.rb +467 -0
- data/lib/xero-ruby/models/payment_service.rb +256 -0
- data/lib/xero-ruby/models/payment_services.rb +205 -0
- data/lib/xero-ruby/models/payment_term.rb +212 -0
- data/lib/xero-ruby/models/payment_term_type.rb +39 -0
- data/lib/xero-ruby/models/payments.rb +205 -0
- data/lib/xero-ruby/models/phone.rb +312 -0
- data/lib/xero-ruby/models/prepayment.rb +413 -0
- data/lib/xero-ruby/models/prepayments.rb +205 -0
- data/lib/xero-ruby/models/purchase.rb +234 -0
- data/lib/xero-ruby/models/purchase_order.rb +523 -0
- data/lib/xero-ruby/models/purchase_orders.rb +205 -0
- data/lib/xero-ruby/models/receipt.rb +420 -0
- data/lib/xero-ruby/models/receipts.rb +205 -0
- data/lib/xero-ruby/models/repeating_invoice.rb +400 -0
- data/lib/xero-ruby/models/repeating_invoices.rb +205 -0
- data/lib/xero-ruby/models/report.rb +299 -0
- data/lib/xero-ruby/models/report_attribute.rb +212 -0
- data/lib/xero-ruby/models/report_cell.rb +214 -0
- data/lib/xero-ruby/models/report_fields.rb +221 -0
- data/lib/xero-ruby/models/report_row.rb +223 -0
- data/lib/xero-ruby/models/report_rows.rb +234 -0
- data/lib/xero-ruby/models/report_with_row.rb +288 -0
- data/lib/xero-ruby/models/report_with_rows.rb +205 -0
- data/lib/xero-ruby/models/reports.rb +205 -0
- data/lib/xero-ruby/models/request_empty.rb +204 -0
- data/lib/xero-ruby/models/row_type.rb +39 -0
- data/lib/xero-ruby/models/sales_tracking_category.rb +214 -0
- data/lib/xero-ruby/models/schedule.rb +310 -0
- data/lib/xero-ruby/models/tax_component.rb +234 -0
- data/lib/xero-ruby/models/tax_rate.rb +367 -0
- data/lib/xero-ruby/models/tax_rates.rb +205 -0
- data/lib/xero-ruby/models/tax_type.rb +87 -0
- data/lib/xero-ruby/models/ten_nintey_nine_contact.rb +414 -0
- data/lib/xero-ruby/models/time_zone.rb +142 -0
- data/lib/xero-ruby/models/tracking_categories.rb +205 -0
- data/lib/xero-ruby/models/tracking_category.rb +320 -0
- data/lib/xero-ruby/models/tracking_option.rb +283 -0
- data/lib/xero-ruby/models/tracking_options.rb +205 -0
- data/lib/xero-ruby/models/user.rb +298 -0
- data/lib/xero-ruby/models/users.rb +205 -0
- data/lib/xero-ruby/models/validation_error.rb +204 -0
- data/lib/xero-ruby/version.rb +15 -0
- data/pkg/xero-ruby-0.1.0.gem +0 -0
- data/pkg/xero-ruby-1.0.0.gem +0 -0
- data/spec/api/accounting_api_spec.rb +2322 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_spec.rb +165 -0
- data/spec/models/account_type_spec.rb +35 -0
- data/spec/models/accounts_payable_spec.rb +47 -0
- data/spec/models/accounts_receivable_spec.rb +47 -0
- data/spec/models/accounts_spec.rb +41 -0
- data/spec/models/address_spec.rb +99 -0
- data/spec/models/allocation_spec.rb +53 -0
- data/spec/models/allocations_spec.rb +41 -0
- data/spec/models/attachment_spec.rb +71 -0
- data/spec/models/attachments_spec.rb +41 -0
- data/spec/models/balances_spec.rb +47 -0
- data/spec/models/bank_transaction_spec.rb +175 -0
- data/spec/models/bank_transactions_spec.rb +41 -0
- data/spec/models/bank_transfer_spec.rb +101 -0
- data/spec/models/bank_transfers_spec.rb +41 -0
- data/spec/models/batch_payment_details_spec.rb +65 -0
- data/spec/models/batch_payment_spec.rb +131 -0
- data/spec/models/batch_payments_spec.rb +41 -0
- data/spec/models/bill_spec.rb +47 -0
- data/spec/models/branding_theme_spec.rb +59 -0
- data/spec/models/branding_themes_spec.rb +41 -0
- data/spec/models/cis_org_setting_spec.rb +53 -0
- data/spec/models/cis_setting_spec.rb +47 -0
- data/spec/models/cis_settings_spec.rb +41 -0
- data/spec/models/contact_group_spec.rb +63 -0
- data/spec/models/contact_groups_spec.rb +41 -0
- data/spec/models/contact_person_spec.rb +59 -0
- data/spec/models/contact_spec.rb +267 -0
- data/spec/models/contacts_spec.rb +41 -0
- data/spec/models/country_code_spec.rb +35 -0
- data/spec/models/credit_note_spec.rb +181 -0
- data/spec/models/credit_notes_spec.rb +41 -0
- data/spec/models/currencies_spec.rb +41 -0
- data/spec/models/currency_code_spec.rb +35 -0
- data/spec/models/currency_spec.rb +47 -0
- data/spec/models/element_spec.rb +41 -0
- data/spec/models/employee_spec.rb +75 -0
- data/spec/models/employees_spec.rb +41 -0
- data/spec/models/error_spec.rb +59 -0
- data/spec/models/expense_claim_spec.rb +111 -0
- data/spec/models/expense_claims_spec.rb +41 -0
- data/spec/models/external_link_spec.rb +57 -0
- data/spec/models/history_record_spec.rb +59 -0
- data/spec/models/history_records_spec.rb +41 -0
- data/spec/models/invoice_reminder_spec.rb +41 -0
- data/spec/models/invoice_reminders_spec.rb +41 -0
- data/spec/models/invoice_spec.rb +259 -0
- data/spec/models/invoices_spec.rb +41 -0
- data/spec/models/item_spec.rb +125 -0
- data/spec/models/items_spec.rb +41 -0
- data/spec/models/journal_line_spec.rb +107 -0
- data/spec/models/journal_spec.rb +87 -0
- data/spec/models/journals_spec.rb +41 -0
- data/spec/models/line_amount_types_spec.rb +35 -0
- data/spec/models/line_item_spec.rb +107 -0
- data/spec/models/line_item_tracking_spec.rb +53 -0
- data/spec/models/linked_transaction_spec.rb +113 -0
- data/spec/models/linked_transactions_spec.rb +41 -0
- data/spec/models/manual_journal_line_spec.rb +77 -0
- data/spec/models/manual_journal_spec.rb +117 -0
- data/spec/models/manual_journals_spec.rb +41 -0
- data/spec/models/online_invoice_spec.rb +41 -0
- data/spec/models/online_invoices_spec.rb +41 -0
- data/spec/models/organisation_spec.rb +255 -0
- data/spec/models/organisations_spec.rb +41 -0
- data/spec/models/overpayment_spec.rb +151 -0
- data/spec/models/overpayments_spec.rb +41 -0
- data/spec/models/payment_service_spec.rb +71 -0
- data/spec/models/payment_services_spec.rb +41 -0
- data/spec/models/payment_spec.rb +181 -0
- data/spec/models/payment_term_spec.rb +47 -0
- data/spec/models/payment_term_type_spec.rb +35 -0
- data/spec/models/payments_spec.rb +41 -0
- data/spec/models/phone_spec.rb +63 -0
- data/spec/models/prepayment_spec.rb +145 -0
- data/spec/models/prepayments_spec.rb +41 -0
- data/spec/models/purchase_order_spec.rb +207 -0
- data/spec/models/purchase_orders_spec.rb +41 -0
- data/spec/models/purchase_spec.rb +59 -0
- data/spec/models/receipt_spec.rb +141 -0
- data/spec/models/receipts_spec.rb +41 -0
- data/spec/models/repeating_invoice_spec.rb +139 -0
- data/spec/models/repeating_invoices_spec.rb +41 -0
- data/spec/models/report_attribute_spec.rb +47 -0
- data/spec/models/report_cell_spec.rb +47 -0
- data/spec/models/report_fields_spec.rb +53 -0
- data/spec/models/report_row_spec.rb +53 -0
- data/spec/models/report_rows_spec.rb +59 -0
- data/spec/models/report_spec.rb +81 -0
- data/spec/models/report_with_row_spec.rb +89 -0
- data/spec/models/report_with_rows_spec.rb +41 -0
- data/spec/models/reports_spec.rb +41 -0
- data/spec/models/request_empty_spec.rb +41 -0
- data/spec/models/row_type_spec.rb +35 -0
- data/spec/models/sales_tracking_category_spec.rb +47 -0
- data/spec/models/schedule_spec.rb +85 -0
- data/spec/models/tax_component_spec.rb +59 -0
- data/spec/models/tax_rate_spec.rb +115 -0
- data/spec/models/tax_rates_spec.rb +41 -0
- data/spec/models/tax_type_spec.rb +35 -0
- data/spec/models/ten_nintey_nine_contact_spec.rb +167 -0
- data/spec/models/time_zone_spec.rb +35 -0
- data/spec/models/tracking_categories_spec.rb +41 -0
- data/spec/models/tracking_category_spec.rb +75 -0
- data/spec/models/tracking_option_spec.rb +63 -0
- data/spec/models/tracking_options_spec.rb +41 -0
- data/spec/models/user_spec.rb +81 -0
- data/spec/models/users_spec.rb +41 -0
- data/spec/models/validation_error_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- data/xero-ruby.gemspec +39 -0
- metadata +563 -0
@@ -0,0 +1,234 @@
|
|
1
|
+
=begin
|
2
|
+
#Accounting API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: api@xero.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'time'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
module XeroRuby
|
17
|
+
class ContactPerson
|
18
|
+
# First name of person
|
19
|
+
attr_accessor :first_name
|
20
|
+
|
21
|
+
# Last name of person
|
22
|
+
attr_accessor :last_name
|
23
|
+
|
24
|
+
# Email address of person
|
25
|
+
attr_accessor :email_address
|
26
|
+
|
27
|
+
# boolean to indicate whether contact should be included on emails with invoices etc.
|
28
|
+
attr_accessor :include_in_emails
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'first_name' => :'FirstName',
|
34
|
+
:'last_name' => :'LastName',
|
35
|
+
:'email_address' => :'EmailAddress',
|
36
|
+
:'include_in_emails' => :'IncludeInEmails'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'first_name' => :'String',
|
44
|
+
:'last_name' => :'String',
|
45
|
+
:'email_address' => :'String',
|
46
|
+
:'include_in_emails' => :'Boolean'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::ContactPerson` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::ContactPerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'first_name')
|
66
|
+
self.first_name = attributes[:'first_name']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'last_name')
|
70
|
+
self.last_name = attributes[:'last_name']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'email_address')
|
74
|
+
self.email_address = attributes[:'email_address']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'include_in_emails')
|
78
|
+
self.include_in_emails = attributes[:'include_in_emails']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
83
|
+
# @return Array for valid properties with the reasons
|
84
|
+
def list_invalid_properties
|
85
|
+
invalid_properties = Array.new
|
86
|
+
invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
true
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks equality by comparing each attribute.
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def ==(o)
|
98
|
+
return true if self.equal?(o)
|
99
|
+
self.class == o.class &&
|
100
|
+
first_name == o.first_name &&
|
101
|
+
last_name == o.last_name &&
|
102
|
+
email_address == o.email_address &&
|
103
|
+
include_in_emails == o.include_in_emails
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Integer] Hash code
|
114
|
+
def hash
|
115
|
+
[first_name, last_name, email_address, include_in_emails].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def self.build_from_hash(attributes)
|
122
|
+
new.build_from_hash(attributes)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
self.class.openapi_types.each_pair do |key, type|
|
131
|
+
if type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
139
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
140
|
+
end
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def _deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :DateTime
|
152
|
+
DateTime.parse(parse_date(value))
|
153
|
+
when :Date
|
154
|
+
Date._iso8601(parse_date(value))
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :Boolean
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
XeroRuby.const_get(type).build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
next if value.nil?
|
205
|
+
hash[param] = _to_hash(value)
|
206
|
+
end
|
207
|
+
hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Outputs non-array value in the form of hash
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
212
|
+
# @param [Object] value Any valid value
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# customized data_parser
|
229
|
+
def parse_date(datestring)
|
230
|
+
seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0
|
231
|
+
return Time.at(seconds_since_epoch).to_s
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
@@ -0,0 +1,205 @@
|
|
1
|
+
=begin
|
2
|
+
#Accounting API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: api@xero.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'time'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
module XeroRuby
|
17
|
+
class Contacts
|
18
|
+
attr_accessor :contacts
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'contacts' => :'Contacts'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'contacts' => :'Array<Contact>'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Initializes the object
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
|
+
def initialize(attributes = {})
|
37
|
+
if (!attributes.is_a?(Hash))
|
38
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Contacts` initialize method"
|
39
|
+
end
|
40
|
+
|
41
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
43
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
44
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Contacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
45
|
+
end
|
46
|
+
h[k.to_sym] = v
|
47
|
+
}
|
48
|
+
|
49
|
+
if attributes.key?(:'contacts')
|
50
|
+
if (value = attributes[:'contacts']).is_a?(Array)
|
51
|
+
self.contacts = value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
+
# @return Array for valid properties with the reasons
|
58
|
+
def list_invalid_properties
|
59
|
+
invalid_properties = Array.new
|
60
|
+
invalid_properties
|
61
|
+
end
|
62
|
+
|
63
|
+
# Check to see if the all the properties in the model are valid
|
64
|
+
# @return true if the model is valid
|
65
|
+
def valid?
|
66
|
+
true
|
67
|
+
end
|
68
|
+
|
69
|
+
# Checks equality by comparing each attribute.
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def ==(o)
|
72
|
+
return true if self.equal?(o)
|
73
|
+
self.class == o.class &&
|
74
|
+
contacts == o.contacts
|
75
|
+
end
|
76
|
+
|
77
|
+
# @see the `==` method
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def eql?(o)
|
80
|
+
self == o
|
81
|
+
end
|
82
|
+
|
83
|
+
# Calculates hash code according to all attributes.
|
84
|
+
# @return [Integer] Hash code
|
85
|
+
def hash
|
86
|
+
[contacts].hash
|
87
|
+
end
|
88
|
+
|
89
|
+
# Builds the object from hash
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
+
# @return [Object] Returns the model itself
|
92
|
+
def self.build_from_hash(attributes)
|
93
|
+
new.build_from_hash(attributes)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Builds the object from hash
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
+
# @return [Object] Returns the model itself
|
99
|
+
def build_from_hash(attributes)
|
100
|
+
return nil unless attributes.is_a?(Hash)
|
101
|
+
self.class.openapi_types.each_pair do |key, type|
|
102
|
+
if type =~ /\AArray<(.*)>/i
|
103
|
+
# check to ensure the input is an array given that the attribute
|
104
|
+
# is documented as an array but the input is not
|
105
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
106
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
107
|
+
end
|
108
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
109
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
110
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
111
|
+
end
|
112
|
+
|
113
|
+
self
|
114
|
+
end
|
115
|
+
|
116
|
+
# Deserializes the data based on type
|
117
|
+
# @param string type Data type
|
118
|
+
# @param string value Value to be deserialized
|
119
|
+
# @return [Object] Deserialized data
|
120
|
+
def _deserialize(type, value)
|
121
|
+
case type.to_sym
|
122
|
+
when :DateTime
|
123
|
+
DateTime.parse(parse_date(value))
|
124
|
+
when :Date
|
125
|
+
Date._iso8601(parse_date(value))
|
126
|
+
when :String
|
127
|
+
value.to_s
|
128
|
+
when :Integer
|
129
|
+
value.to_i
|
130
|
+
when :Float
|
131
|
+
value.to_f
|
132
|
+
when :Boolean
|
133
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
134
|
+
true
|
135
|
+
else
|
136
|
+
false
|
137
|
+
end
|
138
|
+
when :Object
|
139
|
+
# generic object (usually a Hash), return directly
|
140
|
+
value
|
141
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
142
|
+
inner_type = Regexp.last_match[:inner_type]
|
143
|
+
value.map { |v| _deserialize(inner_type, v) }
|
144
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
145
|
+
k_type = Regexp.last_match[:k_type]
|
146
|
+
v_type = Regexp.last_match[:v_type]
|
147
|
+
{}.tap do |hash|
|
148
|
+
value.each do |k, v|
|
149
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
else # model
|
153
|
+
XeroRuby.const_get(type).build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_hash
|
172
|
+
hash = {}
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
174
|
+
value = self.send(attr)
|
175
|
+
next if value.nil?
|
176
|
+
hash[param] = _to_hash(value)
|
177
|
+
end
|
178
|
+
hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Outputs non-array value in the form of hash
|
182
|
+
# For object, use to_hash. Otherwise, just return the value
|
183
|
+
# @param [Object] value Any valid value
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
185
|
+
def _to_hash(value)
|
186
|
+
if value.is_a?(Array)
|
187
|
+
value.compact.map { |v| _to_hash(v) }
|
188
|
+
elsif value.is_a?(Hash)
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
191
|
+
end
|
192
|
+
elsif value.respond_to? :to_hash
|
193
|
+
value.to_hash
|
194
|
+
else
|
195
|
+
value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# customized data_parser
|
200
|
+
def parse_date(datestring)
|
201
|
+
seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0
|
202
|
+
return Time.at(seconds_since_epoch).to_s
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
@@ -0,0 +1,275 @@
|
|
1
|
+
=begin
|
2
|
+
#Accounting API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: api@xero.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'time'
|
14
|
+
require 'date'
|
15
|
+
|
16
|
+
module XeroRuby
|
17
|
+
class CountryCode
|
18
|
+
AD = "AD".freeze
|
19
|
+
AE = "AE".freeze
|
20
|
+
AF = "AF".freeze
|
21
|
+
AG = "AG".freeze
|
22
|
+
AI = "AI".freeze
|
23
|
+
AL = "AL".freeze
|
24
|
+
AM = "AM".freeze
|
25
|
+
AN = "AN".freeze
|
26
|
+
AO = "AO".freeze
|
27
|
+
AQ = "AQ".freeze
|
28
|
+
AR = "AR".freeze
|
29
|
+
AS = "AS".freeze
|
30
|
+
AT = "AT".freeze
|
31
|
+
AU = "AU".freeze
|
32
|
+
AW = "AW".freeze
|
33
|
+
AZ = "AZ".freeze
|
34
|
+
BA = "BA".freeze
|
35
|
+
BB = "BB".freeze
|
36
|
+
BD = "BD".freeze
|
37
|
+
BE = "BE".freeze
|
38
|
+
BF = "BF".freeze
|
39
|
+
BG = "BG".freeze
|
40
|
+
BH = "BH".freeze
|
41
|
+
BI = "BI".freeze
|
42
|
+
BJ = "BJ".freeze
|
43
|
+
BL = "BL".freeze
|
44
|
+
BM = "BM".freeze
|
45
|
+
BN = "BN".freeze
|
46
|
+
BO = "BO".freeze
|
47
|
+
BR = "BR".freeze
|
48
|
+
BS = "BS".freeze
|
49
|
+
BT = "BT".freeze
|
50
|
+
BW = "BW".freeze
|
51
|
+
BY = "BY".freeze
|
52
|
+
BZ = "BZ".freeze
|
53
|
+
CA = "CA".freeze
|
54
|
+
CC = "CC".freeze
|
55
|
+
CD = "CD".freeze
|
56
|
+
CF = "CF".freeze
|
57
|
+
CG = "CG".freeze
|
58
|
+
CH = "CH".freeze
|
59
|
+
CI = "CI".freeze
|
60
|
+
CK = "CK".freeze
|
61
|
+
CL = "CL".freeze
|
62
|
+
CM = "CM".freeze
|
63
|
+
CN = "CN".freeze
|
64
|
+
CO = "CO".freeze
|
65
|
+
CR = "CR".freeze
|
66
|
+
CU = "CU".freeze
|
67
|
+
CV = "CV".freeze
|
68
|
+
CW = "CW".freeze
|
69
|
+
CX = "CX".freeze
|
70
|
+
CY = "CY".freeze
|
71
|
+
CZ = "CZ".freeze
|
72
|
+
DE = "DE".freeze
|
73
|
+
DJ = "DJ".freeze
|
74
|
+
DK = "DK".freeze
|
75
|
+
DM = "DM".freeze
|
76
|
+
DO = "DO".freeze
|
77
|
+
DZ = "DZ".freeze
|
78
|
+
EC = "EC".freeze
|
79
|
+
EE = "EE".freeze
|
80
|
+
EG = "EG".freeze
|
81
|
+
EH = "EH".freeze
|
82
|
+
ER = "ER".freeze
|
83
|
+
ES = "ES".freeze
|
84
|
+
ET = "ET".freeze
|
85
|
+
FI = "FI".freeze
|
86
|
+
FJ = "FJ".freeze
|
87
|
+
FK = "FK".freeze
|
88
|
+
FM = "FM".freeze
|
89
|
+
FO = "FO".freeze
|
90
|
+
FR = "FR".freeze
|
91
|
+
GA = "GA".freeze
|
92
|
+
GB = "GB".freeze
|
93
|
+
GD = "GD".freeze
|
94
|
+
GE = "GE".freeze
|
95
|
+
GG = "GG".freeze
|
96
|
+
GH = "GH".freeze
|
97
|
+
GI = "GI".freeze
|
98
|
+
GL = "GL".freeze
|
99
|
+
GM = "GM".freeze
|
100
|
+
GN = "GN".freeze
|
101
|
+
GQ = "GQ".freeze
|
102
|
+
GR = "GR".freeze
|
103
|
+
GT = "GT".freeze
|
104
|
+
GU = "GU".freeze
|
105
|
+
GW = "GW".freeze
|
106
|
+
GY = "GY".freeze
|
107
|
+
HK = "HK".freeze
|
108
|
+
HN = "HN".freeze
|
109
|
+
HR = "HR".freeze
|
110
|
+
HT = "HT".freeze
|
111
|
+
HU = "HU".freeze
|
112
|
+
ID = "ID".freeze
|
113
|
+
IE = "IE".freeze
|
114
|
+
IL = "IL".freeze
|
115
|
+
IM = "IM".freeze
|
116
|
+
IN = "IN".freeze
|
117
|
+
IO = "IO".freeze
|
118
|
+
IQ = "IQ".freeze
|
119
|
+
IR = "IR".freeze
|
120
|
+
IS = "IS".freeze
|
121
|
+
IT = "IT".freeze
|
122
|
+
JE = "JE".freeze
|
123
|
+
JM = "JM".freeze
|
124
|
+
JO = "JO".freeze
|
125
|
+
JP = "JP".freeze
|
126
|
+
KE = "KE".freeze
|
127
|
+
KG = "KG".freeze
|
128
|
+
KH = "KH".freeze
|
129
|
+
KI = "KI".freeze
|
130
|
+
KM = "KM".freeze
|
131
|
+
KN = "KN".freeze
|
132
|
+
KP = "KP".freeze
|
133
|
+
KR = "KR".freeze
|
134
|
+
KW = "KW".freeze
|
135
|
+
KY = "KY".freeze
|
136
|
+
KZ = "KZ".freeze
|
137
|
+
LA = "LA".freeze
|
138
|
+
LB = "LB".freeze
|
139
|
+
LC = "LC".freeze
|
140
|
+
LI = "LI".freeze
|
141
|
+
LK = "LK".freeze
|
142
|
+
LR = "LR".freeze
|
143
|
+
LS = "LS".freeze
|
144
|
+
LT = "LT".freeze
|
145
|
+
LU = "LU".freeze
|
146
|
+
LV = "LV".freeze
|
147
|
+
LY = "LY".freeze
|
148
|
+
MA = "MA".freeze
|
149
|
+
MC = "MC".freeze
|
150
|
+
MD = "MD".freeze
|
151
|
+
ME = "ME".freeze
|
152
|
+
MF = "MF".freeze
|
153
|
+
MG = "MG".freeze
|
154
|
+
MH = "MH".freeze
|
155
|
+
MK = "MK".freeze
|
156
|
+
ML = "ML".freeze
|
157
|
+
MM = "MM".freeze
|
158
|
+
MN = "MN".freeze
|
159
|
+
MO = "MO".freeze
|
160
|
+
MP = "MP".freeze
|
161
|
+
MR = "MR".freeze
|
162
|
+
MS = "MS".freeze
|
163
|
+
MT = "MT".freeze
|
164
|
+
MU = "MU".freeze
|
165
|
+
MV = "MV".freeze
|
166
|
+
MW = "MW".freeze
|
167
|
+
MX = "MX".freeze
|
168
|
+
MY = "MY".freeze
|
169
|
+
MZ = "MZ".freeze
|
170
|
+
NA = "NA".freeze
|
171
|
+
NC = "NC".freeze
|
172
|
+
NE = "NE".freeze
|
173
|
+
NG = "NG".freeze
|
174
|
+
NI = "NI".freeze
|
175
|
+
NL = "NL".freeze
|
176
|
+
FALSE = "false".freeze
|
177
|
+
NP = "NP".freeze
|
178
|
+
NR = "NR".freeze
|
179
|
+
NU = "NU".freeze
|
180
|
+
NZ = "NZ".freeze
|
181
|
+
OM = "OM".freeze
|
182
|
+
PA = "PA".freeze
|
183
|
+
PE = "PE".freeze
|
184
|
+
PF = "PF".freeze
|
185
|
+
PG = "PG".freeze
|
186
|
+
PH = "PH".freeze
|
187
|
+
PK = "PK".freeze
|
188
|
+
PL = "PL".freeze
|
189
|
+
PM = "PM".freeze
|
190
|
+
PN = "PN".freeze
|
191
|
+
PR = "PR".freeze
|
192
|
+
PS = "PS".freeze
|
193
|
+
PT = "PT".freeze
|
194
|
+
PW = "PW".freeze
|
195
|
+
PY = "PY".freeze
|
196
|
+
QA = "QA".freeze
|
197
|
+
RE = "RE".freeze
|
198
|
+
RO = "RO".freeze
|
199
|
+
RS = "RS".freeze
|
200
|
+
RU = "RU".freeze
|
201
|
+
RW = "RW".freeze
|
202
|
+
SA = "SA".freeze
|
203
|
+
SB = "SB".freeze
|
204
|
+
SC = "SC".freeze
|
205
|
+
SD = "SD".freeze
|
206
|
+
SE = "SE".freeze
|
207
|
+
SG = "SG".freeze
|
208
|
+
SH = "SH".freeze
|
209
|
+
SI = "SI".freeze
|
210
|
+
SJ = "SJ".freeze
|
211
|
+
SK = "SK".freeze
|
212
|
+
SL = "SL".freeze
|
213
|
+
SM = "SM".freeze
|
214
|
+
SN = "SN".freeze
|
215
|
+
SO = "SO".freeze
|
216
|
+
SR = "SR".freeze
|
217
|
+
SS = "SS".freeze
|
218
|
+
ST = "ST".freeze
|
219
|
+
SV = "SV".freeze
|
220
|
+
SX = "SX".freeze
|
221
|
+
SY = "SY".freeze
|
222
|
+
SZ = "SZ".freeze
|
223
|
+
TC = "TC".freeze
|
224
|
+
TD = "TD".freeze
|
225
|
+
TG = "TG".freeze
|
226
|
+
TH = "TH".freeze
|
227
|
+
TJ = "TJ".freeze
|
228
|
+
TK = "TK".freeze
|
229
|
+
TL = "TL".freeze
|
230
|
+
TM = "TM".freeze
|
231
|
+
TN = "TN".freeze
|
232
|
+
TO = "TO".freeze
|
233
|
+
TR = "TR".freeze
|
234
|
+
TT = "TT".freeze
|
235
|
+
TV = "TV".freeze
|
236
|
+
TW = "TW".freeze
|
237
|
+
TZ = "TZ".freeze
|
238
|
+
UA = "UA".freeze
|
239
|
+
UG = "UG".freeze
|
240
|
+
US = "US".freeze
|
241
|
+
UY = "UY".freeze
|
242
|
+
UZ = "UZ".freeze
|
243
|
+
VA = "VA".freeze
|
244
|
+
VC = "VC".freeze
|
245
|
+
VE = "VE".freeze
|
246
|
+
VG = "VG".freeze
|
247
|
+
VI = "VI".freeze
|
248
|
+
VN = "VN".freeze
|
249
|
+
VU = "VU".freeze
|
250
|
+
WF = "WF".freeze
|
251
|
+
WS = "WS".freeze
|
252
|
+
XK = "XK".freeze
|
253
|
+
YE = "YE".freeze
|
254
|
+
YT = "YT".freeze
|
255
|
+
ZA = "ZA".freeze
|
256
|
+
ZM = "ZM".freeze
|
257
|
+
ZW = "ZW".freeze
|
258
|
+
|
259
|
+
# Builds the enum from string
|
260
|
+
# @param [String] The enum value in the form of the string
|
261
|
+
# @return [String] The enum value
|
262
|
+
def self.build_from_hash(value)
|
263
|
+
new.build_from_hash(value)
|
264
|
+
end
|
265
|
+
|
266
|
+
# Builds the enum from string
|
267
|
+
# @param [String] The enum value in the form of the string
|
268
|
+
# @return [String] The enum value
|
269
|
+
def build_from_hash(value)
|
270
|
+
constantValues = CountryCode.constants.select { |c| CountryCode::const_get(c) == value }
|
271
|
+
raise "Invalid ENUM value #{value} for class #CountryCode" if constantValues.empty?
|
272
|
+
value
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|