netsuite-soap 2025.2.3
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/.envrc +9 -0
- data/.github/FUNDING.yml +1 -0
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/main.yml +55 -0
- data/.github/workflows/publish.yml +53 -0
- data/.gitignore +23 -0
- data/.rspec +6 -0
- data/.ruby-version +1 -0
- data/.tool-versions +1 -0
- data/AGENTS.md +150 -0
- data/CLAUDE.md +111 -0
- data/DEVELOPMENT.md +34 -0
- data/Gemfile +10 -0
- data/HISTORY.md +171 -0
- data/LICENSE +22 -0
- data/README.md +87 -0
- data/Rakefile +130 -0
- data/docs/async.md +46 -0
- data/docs/configuration.md +88 -0
- data/docs/contributing.md +36 -0
- data/docs/usage.md +149 -0
- data/lib/netsuite/actions/abstract_action.rb +32 -0
- data/lib/netsuite/actions/add.rb +93 -0
- data/lib/netsuite/actions/async_add_list.rb +74 -0
- data/lib/netsuite/actions/async_delete_list.rb +40 -0
- data/lib/netsuite/actions/async_get_list.rb +46 -0
- data/lib/netsuite/actions/async_initialize_list.rb +85 -0
- data/lib/netsuite/actions/async_response.rb +52 -0
- data/lib/netsuite/actions/async_search.rb +36 -0
- data/lib/netsuite/actions/async_update_list.rb +53 -0
- data/lib/netsuite/actions/async_upsert_list.rb +53 -0
- data/lib/netsuite/actions/attach_file.rb +87 -0
- data/lib/netsuite/actions/check_async_status.rb +29 -0
- data/lib/netsuite/actions/delete.rb +102 -0
- data/lib/netsuite/actions/delete_list.rb +108 -0
- data/lib/netsuite/actions/get.rb +87 -0
- data/lib/netsuite/actions/get_all.rb +78 -0
- data/lib/netsuite/actions/get_async_result.rb +35 -0
- data/lib/netsuite/actions/get_deleted.rb +92 -0
- data/lib/netsuite/actions/get_list.rb +98 -0
- data/lib/netsuite/actions/get_select_value.rb +80 -0
- data/lib/netsuite/actions/initialize.rb +86 -0
- data/lib/netsuite/actions/search.rb +265 -0
- data/lib/netsuite/actions/update.rb +86 -0
- data/lib/netsuite/actions/update_list.rb +113 -0
- data/lib/netsuite/actions/upsert.rb +86 -0
- data/lib/netsuite/actions/upsert_list.rb +118 -0
- data/lib/netsuite/client.rb +19 -0
- data/lib/netsuite/configuration.rb +470 -0
- data/lib/netsuite/errors.rb +18 -0
- data/lib/netsuite/namespaces/act_sched.rb +11 -0
- data/lib/netsuite/namespaces/comm_general.rb +11 -0
- data/lib/netsuite/namespaces/file_cabinet.rb +11 -0
- data/lib/netsuite/namespaces/list_acct.rb +11 -0
- data/lib/netsuite/namespaces/list_emp.rb +12 -0
- data/lib/netsuite/namespaces/list_mkt.rb +12 -0
- data/lib/netsuite/namespaces/list_rel.rb +11 -0
- data/lib/netsuite/namespaces/list_support.rb +11 -0
- data/lib/netsuite/namespaces/list_website.rb +11 -0
- data/lib/netsuite/namespaces/platform_common.rb +11 -0
- data/lib/netsuite/namespaces/platform_core.rb +11 -0
- data/lib/netsuite/namespaces/setup_custom.rb +11 -0
- data/lib/netsuite/namespaces/tran_bank.rb +11 -0
- data/lib/netsuite/namespaces/tran_cust.rb +11 -0
- data/lib/netsuite/namespaces/tran_emp.rb +11 -0
- data/lib/netsuite/namespaces/tran_general.rb +11 -0
- data/lib/netsuite/namespaces/tran_invt.rb +11 -0
- data/lib/netsuite/namespaces/tran_purch.rb +11 -0
- data/lib/netsuite/namespaces/tran_sales.rb +11 -0
- data/lib/netsuite/passports/token.rb +55 -0
- data/lib/netsuite/passports/user.rb +25 -0
- data/lib/netsuite/records/account.rb +30 -0
- data/lib/netsuite/records/accounting_period.rb +25 -0
- data/lib/netsuite/records/address.rb +46 -0
- data/lib/netsuite/records/assembly_build.rb +39 -0
- data/lib/netsuite/records/assembly_component.rb +26 -0
- data/lib/netsuite/records/assembly_component_list.rb +12 -0
- data/lib/netsuite/records/assembly_item.rb +66 -0
- data/lib/netsuite/records/assembly_unbuild.rb +37 -0
- data/lib/netsuite/records/base_ref_list.rb +17 -0
- data/lib/netsuite/records/bill_address.rb +17 -0
- data/lib/netsuite/records/billing_schedule.rb +33 -0
- data/lib/netsuite/records/billing_schedule_milestone.rb +28 -0
- data/lib/netsuite/records/billing_schedule_milestone_list.rb +14 -0
- data/lib/netsuite/records/billing_schedule_recurrence.rb +28 -0
- data/lib/netsuite/records/billing_schedule_recurrence_list.rb +14 -0
- data/lib/netsuite/records/bin.rb +30 -0
- data/lib/netsuite/records/bin_number.rb +18 -0
- data/lib/netsuite/records/bin_number_list.rb +11 -0
- data/lib/netsuite/records/bin_transfer.rb +38 -0
- data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
- data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
- data/lib/netsuite/records/campaign.rb +28 -0
- data/lib/netsuite/records/cash_refund.rb +135 -0
- data/lib/netsuite/records/cash_refund_item.rb +32 -0
- data/lib/netsuite/records/cash_refund_item_list.rb +13 -0
- data/lib/netsuite/records/cash_sale.rb +51 -0
- data/lib/netsuite/records/cash_sale_item.rb +40 -0
- data/lib/netsuite/records/cash_sale_item_list.rb +13 -0
- data/lib/netsuite/records/classification.rb +30 -0
- data/lib/netsuite/records/contact.rb +44 -0
- data/lib/netsuite/records/contact_access_roles.rb +23 -0
- data/lib/netsuite/records/contact_access_roles_list.rb +9 -0
- data/lib/netsuite/records/contact_addressbook.rb +64 -0
- data/lib/netsuite/records/contact_addressbook_list.rb +11 -0
- data/lib/netsuite/records/contact_list.rb +49 -0
- data/lib/netsuite/records/contact_role.rb +23 -0
- data/lib/netsuite/records/cost_category.rb +28 -0
- data/lib/netsuite/records/credit_memo.rb +59 -0
- data/lib/netsuite/records/credit_memo_apply.rb +16 -0
- data/lib/netsuite/records/credit_memo_apply_list.rb +15 -0
- data/lib/netsuite/records/credit_memo_item.rb +34 -0
- data/lib/netsuite/records/credit_memo_item_list.rb +11 -0
- data/lib/netsuite/records/currency.rb +30 -0
- data/lib/netsuite/records/currency_rate.rb +34 -0
- data/lib/netsuite/records/custom_field.rb +23 -0
- data/lib/netsuite/records/custom_field_list.rb +186 -0
- data/lib/netsuite/records/custom_list.rb +27 -0
- data/lib/netsuite/records/custom_list_custom_value.rb +22 -0
- data/lib/netsuite/records/custom_list_custom_value_list.rb +13 -0
- data/lib/netsuite/records/custom_record.rb +56 -0
- data/lib/netsuite/records/custom_record_ref.rb +50 -0
- data/lib/netsuite/records/custom_record_type.rb +30 -0
- data/lib/netsuite/records/customer.rb +265 -0
- data/lib/netsuite/records/customer_addressbook.rb +64 -0
- data/lib/netsuite/records/customer_addressbook_list.rb +11 -0
- data/lib/netsuite/records/customer_category.rb +26 -0
- data/lib/netsuite/records/customer_credit_cards.rb +36 -0
- data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
- data/lib/netsuite/records/customer_currency.rb +28 -0
- data/lib/netsuite/records/customer_currency_list.rb +9 -0
- data/lib/netsuite/records/customer_deposit.rb +47 -0
- data/lib/netsuite/records/customer_deposit_apply.rb +17 -0
- data/lib/netsuite/records/customer_deposit_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_partner.rb +24 -0
- data/lib/netsuite/records/customer_partners_list.rb +9 -0
- data/lib/netsuite/records/customer_payment.rb +56 -0
- data/lib/netsuite/records/customer_payment_apply.rb +17 -0
- data/lib/netsuite/records/customer_payment_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_payment_credit.rb +17 -0
- data/lib/netsuite/records/customer_payment_credit_list.rb +12 -0
- data/lib/netsuite/records/customer_refund.rb +52 -0
- data/lib/netsuite/records/customer_refund_apply.rb +16 -0
- data/lib/netsuite/records/customer_refund_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_refund_deposit.rb +16 -0
- data/lib/netsuite/records/customer_refund_deposit_list.rb +11 -0
- data/lib/netsuite/records/customer_sales_team.rb +24 -0
- data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
- data/lib/netsuite/records/customer_status.rb +29 -0
- data/lib/netsuite/records/department.rb +27 -0
- data/lib/netsuite/records/deposit.rb +40 -0
- data/lib/netsuite/records/deposit_application.rb +64 -0
- data/lib/netsuite/records/deposit_cash_back.rb +42 -0
- data/lib/netsuite/records/deposit_cash_back_list.rb +9 -0
- data/lib/netsuite/records/deposit_other.rb +35 -0
- data/lib/netsuite/records/deposit_other_list.rb +9 -0
- data/lib/netsuite/records/deposit_payment.rb +48 -0
- data/lib/netsuite/records/deposit_payment_list.rb +14 -0
- data/lib/netsuite/records/description_item.rb +34 -0
- data/lib/netsuite/records/discount_item.rb +37 -0
- data/lib/netsuite/records/duration.rb +15 -0
- data/lib/netsuite/records/employee.rb +42 -0
- data/lib/netsuite/records/entity_custom_field.rb +53 -0
- data/lib/netsuite/records/estimate.rb +122 -0
- data/lib/netsuite/records/estimate_item.rb +47 -0
- data/lib/netsuite/records/estimate_item_list.rb +11 -0
- data/lib/netsuite/records/file.rb +31 -0
- data/lib/netsuite/records/folder.rb +26 -0
- data/lib/netsuite/records/gift_cert_redemption.rb +22 -0
- data/lib/netsuite/records/gift_cert_redemption_list.rb +11 -0
- data/lib/netsuite/records/gift_certificate.rb +30 -0
- data/lib/netsuite/records/gift_certificate_item.rb +84 -0
- data/lib/netsuite/records/inbound_shipment.rb +32 -0
- data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
- data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
- data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
- data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
- data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +12 -0
- data/lib/netsuite/records/inventory_adjustment.rb +30 -0
- data/lib/netsuite/records/inventory_adjustment_inventory.rb +21 -0
- data/lib/netsuite/records/inventory_adjustment_inventory_list.rb +10 -0
- data/lib/netsuite/records/inventory_assignment.rb +24 -0
- data/lib/netsuite/records/inventory_assignment_list.rb +35 -0
- data/lib/netsuite/records/inventory_detail.rb +18 -0
- data/lib/netsuite/records/inventory_item.rb +341 -0
- data/lib/netsuite/records/inventory_number.rb +34 -0
- data/lib/netsuite/records/inventory_number_locations.rb +16 -0
- data/lib/netsuite/records/inventory_number_locations_list.rb +10 -0
- data/lib/netsuite/records/inventory_transfer.rb +30 -0
- data/lib/netsuite/records/inventory_transfer_inventory.rb +21 -0
- data/lib/netsuite/records/inventory_transfer_inventory_list.rb +10 -0
- data/lib/netsuite/records/invoice.rb +167 -0
- data/lib/netsuite/records/invoice_item.rb +46 -0
- data/lib/netsuite/records/invoice_item_list.rb +15 -0
- data/lib/netsuite/records/item_availability.rb +45 -0
- data/lib/netsuite/records/item_fulfillment.rb +62 -0
- data/lib/netsuite/records/item_fulfillment_item.rb +45 -0
- data/lib/netsuite/records/item_fulfillment_item_list.rb +14 -0
- data/lib/netsuite/records/item_fulfillment_package.rb +24 -0
- data/lib/netsuite/records/item_fulfillment_package_fed_ex.rb +28 -0
- data/lib/netsuite/records/item_fulfillment_package_fed_ex_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment_package_list.rb +37 -0
- data/lib/netsuite/records/item_fulfillment_package_ups.rb +27 -0
- data/lib/netsuite/records/item_fulfillment_package_ups_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment_package_usps.rb +26 -0
- data/lib/netsuite/records/item_fulfillment_package_usps_list.rb +32 -0
- data/lib/netsuite/records/item_group.rb +37 -0
- data/lib/netsuite/records/item_member.rb +26 -0
- data/lib/netsuite/records/item_member_list.rb +12 -0
- data/lib/netsuite/records/item_option_custom_field.rb +52 -0
- data/lib/netsuite/records/item_receipt.rb +46 -0
- data/lib/netsuite/records/item_receipt_item.rb +43 -0
- data/lib/netsuite/records/item_receipt_item_list.rb +11 -0
- data/lib/netsuite/records/item_vendor.rb +24 -0
- data/lib/netsuite/records/item_vendor_list.rb +11 -0
- data/lib/netsuite/records/job.rb +41 -0
- data/lib/netsuite/records/job_status.rb +25 -0
- data/lib/netsuite/records/journal_entry.rb +48 -0
- data/lib/netsuite/records/journal_entry_line.rb +27 -0
- data/lib/netsuite/records/journal_entry_line_list.rb +12 -0
- data/lib/netsuite/records/kit_item.rb +71 -0
- data/lib/netsuite/records/location.rb +40 -0
- data/lib/netsuite/records/locations_list.rb +15 -0
- data/lib/netsuite/records/lot_numbered_assembly_item.rb +64 -0
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +260 -0
- data/lib/netsuite/records/matrix_option_list.rb +71 -0
- data/lib/netsuite/records/member_list.rb +10 -0
- data/lib/netsuite/records/message.rb +30 -0
- data/lib/netsuite/records/non_inventory_purchase_item.rb +52 -0
- data/lib/netsuite/records/non_inventory_resale_item.rb +189 -0
- data/lib/netsuite/records/non_inventory_sale_item.rb +165 -0
- data/lib/netsuite/records/note.rb +33 -0
- data/lib/netsuite/records/note_type.rb +27 -0
- data/lib/netsuite/records/null_field_list.rb +15 -0
- data/lib/netsuite/records/opportunity.rb +45 -0
- data/lib/netsuite/records/opportunity_item.rb +41 -0
- data/lib/netsuite/records/opportunity_item_list.rb +9 -0
- data/lib/netsuite/records/other_charge_sale_item.rb +73 -0
- data/lib/netsuite/records/partner.rb +35 -0
- data/lib/netsuite/records/payment_item.rb +36 -0
- data/lib/netsuite/records/payment_method.rb +28 -0
- data/lib/netsuite/records/payroll_item.rb +36 -0
- data/lib/netsuite/records/phone_call.rb +29 -0
- data/lib/netsuite/records/price.rb +17 -0
- data/lib/netsuite/records/price_level.rb +26 -0
- data/lib/netsuite/records/price_list.rb +9 -0
- data/lib/netsuite/records/pricing.rb +20 -0
- data/lib/netsuite/records/pricing_matrix.rb +11 -0
- data/lib/netsuite/records/promotion_code.rb +38 -0
- data/lib/netsuite/records/promotions.rb +26 -0
- data/lib/netsuite/records/promotions_list.rb +9 -0
- data/lib/netsuite/records/purchase_order.rb +52 -0
- data/lib/netsuite/records/purchase_order_item.rb +42 -0
- data/lib/netsuite/records/purchase_order_item_list.rb +11 -0
- data/lib/netsuite/records/record_ref.rb +38 -0
- data/lib/netsuite/records/record_ref_list.rb +22 -0
- data/lib/netsuite/records/return_authorization.rb +135 -0
- data/lib/netsuite/records/return_authorization_item.rb +43 -0
- data/lib/netsuite/records/return_authorization_item_list.rb +11 -0
- data/lib/netsuite/records/rev_rec_schedule.rb +32 -0
- data/lib/netsuite/records/rev_rec_template.rb +25 -0
- data/lib/netsuite/records/role_list.rb +24 -0
- data/lib/netsuite/records/roles.rb +17 -0
- data/lib/netsuite/records/sales_order.rb +61 -0
- data/lib/netsuite/records/sales_order_item.rb +49 -0
- data/lib/netsuite/records/sales_order_item_list.rb +11 -0
- data/lib/netsuite/records/sales_order_ship_group_list.rb +11 -0
- data/lib/netsuite/records/sales_role.rb +26 -0
- data/lib/netsuite/records/sales_tax_item.rb +34 -0
- data/lib/netsuite/records/serialized_assembly_item.rb +240 -0
- data/lib/netsuite/records/serialized_inventory_item.rb +248 -0
- data/lib/netsuite/records/serialized_inventory_item_location.rb +36 -0
- data/lib/netsuite/records/serialized_inventory_item_locations_list.rb +10 -0
- data/lib/netsuite/records/serialized_inventory_item_numbers.rb +15 -0
- data/lib/netsuite/records/serialized_inventory_item_numbers_list.rb +10 -0
- data/lib/netsuite/records/service_resale_item.rb +154 -0
- data/lib/netsuite/records/service_sale_item.rb +50 -0
- data/lib/netsuite/records/ship_address.rb +17 -0
- data/lib/netsuite/records/site_category.rb +33 -0
- data/lib/netsuite/records/subscription.rb +18 -0
- data/lib/netsuite/records/subscriptions_list.rb +10 -0
- data/lib/netsuite/records/subsidiary.rb +38 -0
- data/lib/netsuite/records/subtotal_item.rb +34 -0
- data/lib/netsuite/records/support_case.rb +32 -0
- data/lib/netsuite/records/support_case_type.rb +26 -0
- data/lib/netsuite/records/task.rb +31 -0
- data/lib/netsuite/records/tax_group.rb +35 -0
- data/lib/netsuite/records/tax_type.rb +22 -0
- data/lib/netsuite/records/term.rb +27 -0
- data/lib/netsuite/records/time_bill.rb +32 -0
- data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
- data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
- data/lib/netsuite/records/transaction_ship_group.rb +40 -0
- data/lib/netsuite/records/transfer_order.rb +45 -0
- data/lib/netsuite/records/transfer_order_item.rb +43 -0
- data/lib/netsuite/records/transfer_order_item_list.rb +11 -0
- data/lib/netsuite/records/translation.rb +17 -0
- data/lib/netsuite/records/translation_list.rb +11 -0
- data/lib/netsuite/records/units_type.rb +25 -0
- data/lib/netsuite/records/units_type_uom.rb +20 -0
- data/lib/netsuite/records/units_type_uom_list.rb +12 -0
- data/lib/netsuite/records/vendor.rb +46 -0
- data/lib/netsuite/records/vendor_bill.rb +53 -0
- data/lib/netsuite/records/vendor_bill_expense.rb +40 -0
- data/lib/netsuite/records/vendor_bill_expense_list.rb +13 -0
- data/lib/netsuite/records/vendor_bill_item.rb +46 -0
- data/lib/netsuite/records/vendor_bill_item_list.rb +12 -0
- data/lib/netsuite/records/vendor_category.rb +26 -0
- data/lib/netsuite/records/vendor_credit.rb +54 -0
- data/lib/netsuite/records/vendor_credit_apply.rb +18 -0
- data/lib/netsuite/records/vendor_credit_apply_list.rb +12 -0
- data/lib/netsuite/records/vendor_credit_expense.rb +31 -0
- data/lib/netsuite/records/vendor_credit_expense_list.rb +12 -0
- data/lib/netsuite/records/vendor_credit_item.rb +34 -0
- data/lib/netsuite/records/vendor_credit_item_list.rb +12 -0
- data/lib/netsuite/records/vendor_currency.rb +26 -0
- data/lib/netsuite/records/vendor_currency_list.rb +9 -0
- data/lib/netsuite/records/vendor_payment.rb +52 -0
- data/lib/netsuite/records/vendor_payment_apply.rb +16 -0
- data/lib/netsuite/records/vendor_payment_apply_list.rb +12 -0
- data/lib/netsuite/records/vendor_return_authorization.rb +30 -0
- data/lib/netsuite/records/vendor_return_authorization_item.rb +23 -0
- data/lib/netsuite/records/vendor_return_authorization_item_list.rb +12 -0
- data/lib/netsuite/records/work_order.rb +45 -0
- data/lib/netsuite/records/work_order_item.rb +30 -0
- data/lib/netsuite/records/work_order_item_list.rb +11 -0
- data/lib/netsuite/response.rb +20 -0
- data/lib/netsuite/rest/utilities/request.rb +62 -0
- data/lib/netsuite/rest/utilities/roles.rb +47 -0
- data/lib/netsuite/support/actions.rb +74 -0
- data/lib/netsuite/support/attributes.rb +22 -0
- data/lib/netsuite/support/country.rb +289 -0
- data/lib/netsuite/support/fields.rb +86 -0
- data/lib/netsuite/support/record_refs.rb +30 -0
- data/lib/netsuite/support/records.rb +89 -0
- data/lib/netsuite/support/requests.rb +56 -0
- data/lib/netsuite/support/search_result.rb +150 -0
- data/lib/netsuite/support/sublist.rb +71 -0
- data/lib/netsuite/utilities/data_center.rb +53 -0
- data/lib/netsuite/utilities/strings.rb +15 -0
- data/lib/netsuite/utilities.rb +324 -0
- data/lib/netsuite/version.rb +3 -0
- data/lib/netsuite.rb +348 -0
- data/netsuite.gemspec +30 -0
- data/spec/integration/soap_http_spec.rb +76 -0
- data/spec/netsuite/actions/add_spec.rb +155 -0
- data/spec/netsuite/actions/async_add_list_spec.rb +123 -0
- data/spec/netsuite/actions/async_delete_list_spec.rb +60 -0
- data/spec/netsuite/actions/async_get_list_spec.rb +78 -0
- data/spec/netsuite/actions/async_initialize_list_spec.rb +106 -0
- data/spec/netsuite/actions/async_lifecycle_spec.rb +51 -0
- data/spec/netsuite/actions/async_response_spec.rb +187 -0
- data/spec/netsuite/actions/async_search_spec.rb +27 -0
- data/spec/netsuite/actions/async_update_list_spec.rb +80 -0
- data/spec/netsuite/actions/async_upsert_list_spec.rb +157 -0
- data/spec/netsuite/actions/attach_file_spec.rb +59 -0
- data/spec/netsuite/actions/check_async_status_spec.rb +29 -0
- data/spec/netsuite/actions/delete_list_spec.rb +86 -0
- data/spec/netsuite/actions/delete_spec.rb +93 -0
- data/spec/netsuite/actions/get_all_spec.rb +100 -0
- data/spec/netsuite/actions/get_async_result_spec.rb +78 -0
- data/spec/netsuite/actions/get_deleted_spec.rb +60 -0
- data/spec/netsuite/actions/get_list_spec.rb +157 -0
- data/spec/netsuite/actions/get_select_value_spec.rb +43 -0
- data/spec/netsuite/actions/get_spec.rb +72 -0
- data/spec/netsuite/actions/initialize_spec.rb +34 -0
- data/spec/netsuite/actions/search_spec.rb +387 -0
- data/spec/netsuite/actions/update_list_spec.rb +107 -0
- data/spec/netsuite/actions/update_spec.rb +133 -0
- data/spec/netsuite/actions/upsert_list_spec.rb +112 -0
- data/spec/netsuite/actions/upsert_spec.rb +117 -0
- data/spec/netsuite/configuration_spec.rb +661 -0
- data/spec/netsuite/records/account_spec.rb +107 -0
- data/spec/netsuite/records/accounting_period_spec.rb +138 -0
- data/spec/netsuite/records/address_spec.rb +139 -0
- data/spec/netsuite/records/assembly_item_spec.rb +64 -0
- data/spec/netsuite/records/basic_record_spec.rb +128 -0
- data/spec/netsuite/records/bill_address_spec.rb +52 -0
- data/spec/netsuite/records/billing_schedule_milestone_list_spec.rb +24 -0
- data/spec/netsuite/records/billing_schedule_milestone_spec.rb +51 -0
- data/spec/netsuite/records/billing_schedule_recurrence_list_spec.rb +24 -0
- data/spec/netsuite/records/billing_schedule_recurrence_spec.rb +49 -0
- data/spec/netsuite/records/billing_schedule_spec.rb +164 -0
- data/spec/netsuite/records/bin_number_spec.rb +23 -0
- data/spec/netsuite/records/campaign_spec.rb +43 -0
- data/spec/netsuite/records/cash_refund_item_list_spec.rb +27 -0
- data/spec/netsuite/records/cash_refund_item_spec.rb +27 -0
- data/spec/netsuite/records/cash_refund_spec.rb +152 -0
- data/spec/netsuite/records/cash_sale_item_list_spec.rb +27 -0
- data/spec/netsuite/records/cash_sale_item_spec.rb +23 -0
- data/spec/netsuite/records/cash_sale_spec.rb +34 -0
- data/spec/netsuite/records/classification_spec.rb +77 -0
- data/spec/netsuite/records/cost_category_spec.rb +105 -0
- data/spec/netsuite/records/credit_memo_apply_list_spec.rb +27 -0
- data/spec/netsuite/records/credit_memo_apply_spec.rb +14 -0
- data/spec/netsuite/records/credit_memo_item_list_spec.rb +26 -0
- data/spec/netsuite/records/credit_memo_item_spec.rb +29 -0
- data/spec/netsuite/records/credit_memo_spec.rb +213 -0
- data/spec/netsuite/records/currency_rate_spec.rb +45 -0
- data/spec/netsuite/records/custom_field_list_spec.rb +276 -0
- data/spec/netsuite/records/custom_list_spec.rb +21 -0
- data/spec/netsuite/records/custom_record_spec.rb +125 -0
- data/spec/netsuite/records/custom_record_type_spec.rb +114 -0
- data/spec/netsuite/records/customer_addressbook_list_spec.rb +41 -0
- data/spec/netsuite/records/customer_addressbook_spec.rb +105 -0
- data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
- data/spec/netsuite/records/customer_payment_apply_list_spec.rb +25 -0
- data/spec/netsuite/records/customer_payment_credit_list_spec.rb +26 -0
- data/spec/netsuite/records/customer_payment_spec.rb +168 -0
- data/spec/netsuite/records/customer_refund_apply_list_spec.rb +25 -0
- data/spec/netsuite/records/customer_refund_apply_spec.rb +14 -0
- data/spec/netsuite/records/customer_refund_deposit_list_spec.rb +25 -0
- data/spec/netsuite/records/customer_refund_deposit_spec.rb +14 -0
- data/spec/netsuite/records/customer_refund_spec.rb +205 -0
- data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
- data/spec/netsuite/records/customer_spec.rb +561 -0
- data/spec/netsuite/records/department_spec.rb +103 -0
- data/spec/netsuite/records/deposit_spec.rb +165 -0
- data/spec/netsuite/records/discount_item_spec.rb +125 -0
- data/spec/netsuite/records/duration_spec.rb +14 -0
- data/spec/netsuite/records/employee_spec.rb +148 -0
- data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
- data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
- data/spec/netsuite/records/estimate_item_spec.rb +35 -0
- data/spec/netsuite/records/estimate_spec.rb +274 -0
- data/spec/netsuite/records/file_spec.rb +11 -0
- data/spec/netsuite/records/folder_spec.rb +33 -0
- data/spec/netsuite/records/gift_cert_redemption_list_spec.rb +26 -0
- data/spec/netsuite/records/gift_cert_redemption_spec.rb +21 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
- data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
- data/spec/netsuite/records/inventory_assignment_list_spec.rb +59 -0
- data/spec/netsuite/records/inventory_assignment_spec.rb +21 -0
- data/spec/netsuite/records/inventory_detail_spec.rb +13 -0
- data/spec/netsuite/records/inventory_item_spec.rb +532 -0
- data/spec/netsuite/records/inventory_transfer_spec.rb +79 -0
- data/spec/netsuite/records/invoice_item_list_spec.rb +24 -0
- data/spec/netsuite/records/invoice_item_spec.rb +79 -0
- data/spec/netsuite/records/invoice_spec.rb +494 -0
- data/spec/netsuite/records/item_availability_spec.rb +59 -0
- data/spec/netsuite/records/item_fulfillment_package_fed_ex_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_ups_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_usps_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_spec.rb +49 -0
- data/spec/netsuite/records/item_group_spec.rb +117 -0
- data/spec/netsuite/records/item_member_list_spec.rb +26 -0
- data/spec/netsuite/records/item_option_custom_field_spec.rb +27 -0
- data/spec/netsuite/records/item_vendor_list_spec.rb +27 -0
- data/spec/netsuite/records/item_vendor_spec.rb +27 -0
- data/spec/netsuite/records/job_spec.rb +201 -0
- data/spec/netsuite/records/journal_entry_line_list_spec.rb +26 -0
- data/spec/netsuite/records/journal_entry_line_spec.rb +59 -0
- data/spec/netsuite/records/journal_entry_spec.rb +156 -0
- data/spec/netsuite/records/kit_item_spec.rb +117 -0
- data/spec/netsuite/records/location_spec.rb +51 -0
- data/spec/netsuite/records/lot_numbered_inventory_item_spec.rb +247 -0
- data/spec/netsuite/records/matrix_option_list_spec.rb +61 -0
- data/spec/netsuite/records/message_spec.rb +49 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +300 -0
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +278 -0
- data/spec/netsuite/records/note_spec.rb +134 -0
- data/spec/netsuite/records/note_type_spec.rb +88 -0
- data/spec/netsuite/records/null_field_list_spec.rb +30 -0
- data/spec/netsuite/records/partner_spec.rb +143 -0
- data/spec/netsuite/records/payment_item_spec.rb +117 -0
- data/spec/netsuite/records/payment_method_spec.rb +49 -0
- data/spec/netsuite/records/phone_call_spec.rb +17 -0
- data/spec/netsuite/records/pomo_code_spec.rb +40 -0
- data/spec/netsuite/records/price_level_spec.rb +16 -0
- data/spec/netsuite/records/pricing_matrix_spec.rb +27 -0
- data/spec/netsuite/records/record_ref_spec.rb +87 -0
- data/spec/netsuite/records/return_authorization_item_list_spec.rb +26 -0
- data/spec/netsuite/records/return_authorization_item_spec.rb +31 -0
- data/spec/netsuite/records/return_authorization_spec.rb +62 -0
- data/spec/netsuite/records/rev_rec_template_spec.rb +39 -0
- data/spec/netsuite/records/sales_order_item_list_spec.rb +26 -0
- data/spec/netsuite/records/sales_order_item_spec.rb +36 -0
- data/spec/netsuite/records/sales_order_spec.rb +250 -0
- data/spec/netsuite/records/sales_tax_item_spec.rb +26 -0
- data/spec/netsuite/records/service_resale_item_spec.rb +239 -0
- data/spec/netsuite/records/service_sale_item_spec.rb +135 -0
- data/spec/netsuite/records/ship_address_spec.rb +36 -0
- data/spec/netsuite/records/site_category_spec.rb +51 -0
- data/spec/netsuite/records/subscription_spec.rb +37 -0
- data/spec/netsuite/records/subscriptions_list_spec.rb +19 -0
- data/spec/netsuite/records/subsidiary_spec.rb +25 -0
- data/spec/netsuite/records/support_case_spec.rb +157 -0
- data/spec/netsuite/records/support_case_type_spec.rb +22 -0
- data/spec/netsuite/records/tax_type_spec.rb +11 -0
- data/spec/netsuite/records/term_spec.rb +96 -0
- data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/translation_list_spec.rb +34 -0
- data/spec/netsuite/records/translation_spec.rb +28 -0
- data/spec/netsuite/records/units_type_spec.rb +33 -0
- data/spec/netsuite/records/units_type_uom_list_spec.rb +23 -0
- data/spec/netsuite/records/units_type_uom_spec.rb +14 -0
- data/spec/netsuite/records/vendor_bill_expense_list_spec.rb +36 -0
- data/spec/netsuite/records/vendor_bill_expense_spec.rb +72 -0
- data/spec/netsuite/records/vendor_bill_item_list_spec.rb +36 -0
- data/spec/netsuite/records/vendor_bill_item_spec.rb +118 -0
- data/spec/netsuite/records/vendor_bill_spec.rb +187 -0
- data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
- data/spec/netsuite/records/vendor_payment_apply_list_spec.rb +25 -0
- data/spec/netsuite/records/vendor_payment_apply_spec.rb +15 -0
- data/spec/netsuite/records/vendor_payment_spec.rb +164 -0
- data/spec/netsuite/records/vendor_spec.rb +145 -0
- data/spec/netsuite/records/work_order_item_list_spec.rb +26 -0
- data/spec/netsuite/records/work_order_item_spec.rb +45 -0
- data/spec/netsuite/records/work_order_spec.rb +92 -0
- data/spec/netsuite/response_spec.rb +34 -0
- data/spec/netsuite/support/fields_spec.rb +107 -0
- data/spec/netsuite/support/record_refs_spec.rb +14 -0
- data/spec/netsuite/support/records_spec.rb +60 -0
- data/spec/netsuite/support/refresh_spec.rb +28 -0
- data/spec/netsuite/support/requests_spec.rb +38 -0
- data/spec/netsuite/support/search_result_spec.rb +53 -0
- data/spec/netsuite/support/sublist_spec.rb +42 -0
- data/spec/netsuite/utilities/data_center_spec.rb +110 -0
- data/spec/netsuite/utilities/request_spec.rb +29 -0
- data/spec/netsuite/utilities/roles_spec.rb +145 -0
- data/spec/netsuite/utilities_spec.rb +140 -0
- data/spec/netsuite_spec.rb +41 -0
- data/spec/spec_helper.rb +50 -0
- data/spec/support/configuration.rb +23 -0
- data/spec/support/field_matcher.rb +21 -0
- data/spec/support/fixtures/add/add_customer.xml +16 -0
- data/spec/support/fixtures/add/add_file.xml +20 -0
- data/spec/support/fixtures/add/add_invoice.xml +20 -0
- data/spec/support/fixtures/add/add_invoice_error.xml +19 -0
- data/spec/support/fixtures/add/add_invoice_multiple_errors.xml +24 -0
- data/spec/support/fixtures/async_add_list/async_add_list_pending.xml +18 -0
- data/spec/support/fixtures/async_delete_list/async_delete_list_pending.xml +18 -0
- data/spec/support/fixtures/async_get_list/async_get_list_pending.xml +18 -0
- data/spec/support/fixtures/async_initialize_list/async_initialize_list_pending.xml +18 -0
- data/spec/support/fixtures/async_search/async_search_pending.xml +18 -0
- data/spec/support/fixtures/async_update_list/async_update_list_pending.xml +18 -0
- data/spec/support/fixtures/async_upsert_list/async_upsert_list_customers.xml +16 -0
- data/spec/support/fixtures/async_upsert_list/async_upsert_list_one_customer.xml +16 -0
- data/spec/support/fixtures/async_upsert_list/async_upsert_list_with_errors.xml +21 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order.xml +16 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order_error.xml +20 -0
- data/spec/support/fixtures/check_async_status/check_async_status_pending.xml +18 -0
- data/spec/support/fixtures/custom_fields/multi_select.xml +47 -0
- data/spec/support/fixtures/delete/delete_customer.xml +16 -0
- data/spec/support/fixtures/delete/delete_customer_error.xml +21 -0
- data/spec/support/fixtures/delete/delete_customer_multiple_errors.xml +25 -0
- data/spec/support/fixtures/delete_list/delete_list_customers.xml +26 -0
- data/spec/support/fixtures/delete_list/delete_list_customers_with_errors.xml +31 -0
- data/spec/support/fixtures/get/get_customer.xml +61 -0
- data/spec/support/fixtures/get/get_invoice.xml +101 -0
- data/spec/support/fixtures/get_all/get_all_currencies.xml +24 -0
- data/spec/support/fixtures/get_all/get_all_error.xml +15 -0
- data/spec/support/fixtures/get_async_result/get_async_result_finished.xml +22 -0
- data/spec/support/fixtures/get_async_result/get_async_result_upsert_list_finished.xml +26 -0
- data/spec/support/fixtures/get_async_result/get_async_result_write_list_multiple.xml +34 -0
- data/spec/support/fixtures/get_deleted/get_deleted_invoices.xml +38 -0
- data/spec/support/fixtures/get_item_availability/get_item_availability.xml +46 -0
- data/spec/support/fixtures/get_list/get_list_customer_error.xml +22 -0
- data/spec/support/fixtures/get_list/get_list_customers.xml +21 -0
- data/spec/support/fixtures/get_list/get_list_customers_multiple.xml +28 -0
- data/spec/support/fixtures/get_select_value/empty_result.xml +22 -0
- data/spec/support/fixtures/get_select_value/item_fulfillment_ship_method.xml +43 -0
- data/spec/support/fixtures/initialize/initialize_invoice_from_customer.xml +69 -0
- data/spec/support/fixtures/login/failure_concurrent_requests.xml +15 -0
- data/spec/support/fixtures/login/failure_invalid_credentials.xml +15 -0
- data/spec/support/fixtures/login/success.xml +35 -0
- data/spec/support/fixtures/search/basic_search_contact.xml +39 -0
- data/spec/support/fixtures/search/saved_search_customer.xml +54 -0
- data/spec/support/fixtures/search/saved_search_item.xml +55 -0
- data/spec/support/fixtures/search/saved_search_joined_custom_customer.xml +101 -0
- data/spec/support/fixtures/search/single_search_result.xml +46 -0
- data/spec/support/fixtures/soap/v2025_2_0/wsdl/netsuite.wsdl +2531 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/activities/scheduling.xsd +603 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/activities/schedulingTypes.xsd +198 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/documents/fileCabinet.xsd +159 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/documents/fileCabinetTypes.xsd +110 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/general/communication.xsd +210 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/general/communicationTypes.xsd +20 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/accounting.xsd +6768 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/accountingTypes.xsd +1043 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/employeeTypes.xsd +344 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/employees.xsd +518 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/marketing.xsd +528 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/marketingTypes.xsd +145 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/relationshipTypes.xsd +190 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/relationships.xsd +1658 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/supplyChain.xsd +282 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/supplyChainTypes.xsd +26 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/support.xsd +534 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/supportTypes.xsd +74 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/website.xsd +99 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/websiteTypes.xsd +2 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/common.xsd +8411 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/commonTypes.xsd +1371 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/core.xsd +1096 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/coreTypes.xsd +877 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/faultTypes.xsd +1446 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/faults.xsd +82 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/messages.xsd +664 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/setup/customization.xsd +1604 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/setup/customizationTypes.xsd +119 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/bank.xsd +212 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/bankTypes.xsd +2 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/customerTypes.xsd +99 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/customers.xsd +1131 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/demandPlanning.xsd +173 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/demandPlanningTypes.xsd +52 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/employeeTypes.xsd +10 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/employees.xsd +723 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/financial.xsd +88 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/financialTypes.xsd +9 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/general.xsd +364 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/inventory.xsd +780 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/inventoryTypes.xsd +49 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/purchaseTypes.xsd +44 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/purchases.xsd +986 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/saleTypes.xsd +754 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/sales.xsd +2025 -0
- data/spec/support/fixtures/update/update_customer.xml +16 -0
- data/spec/support/fixtures/update/update_customer_error.xml +21 -0
- data/spec/support/fixtures/update/update_customer_multiple_errors.xml +25 -0
- data/spec/support/fixtures/update/update_invoice.xml +16 -0
- data/spec/support/fixtures/update_list/update_list_items.xml +22 -0
- data/spec/support/fixtures/update_list/update_list_one_item.xml +18 -0
- data/spec/support/fixtures/update_list/update_list_with_errors.xml +32 -0
- data/spec/support/fixtures/upsert/upsert_customer.xml +16 -0
- data/spec/support/fixtures/upsert/upsert_invoice.xml +16 -0
- data/spec/support/fixtures/upsert/upsert_invoice_error.xml +20 -0
- data/spec/support/fixtures/upsert/upsert_invoice_multiple_errors.xml +24 -0
- data/spec/support/fixtures/upsert_list/upsert_list_customers.xml +21 -0
- data/spec/support/fixtures/upsert_list/upsert_list_one_customer.xml +17 -0
- data/spec/support/fixtures/upsert_list/upsert_list_with_errors.xml +32 -0
- data/spec/support/read_only_field_matcher.rb +7 -0
- data/spec/support/record_ref_matcher.rb +25 -0
- data/spec/support/savon.rb +5 -0
- data/spec/support/search_only_field_matcher.rb +7 -0
- data/spec/support/webmock_soap_helper.rb +15 -0
- data/workflow.md +368 -0
- metadata +764 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
module Configuration
|
|
3
|
+
extend self
|
|
4
|
+
|
|
5
|
+
def reset!
|
|
6
|
+
NetSuite::Utilities.clear_cache!
|
|
7
|
+
|
|
8
|
+
clear_wsdl_cache
|
|
9
|
+
|
|
10
|
+
attributes.clear
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def attributes
|
|
14
|
+
if multi_tenant?
|
|
15
|
+
Thread.current[:netsuite_gem_attributes] ||= {}
|
|
16
|
+
else
|
|
17
|
+
@attributes ||= {}
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def connection(params={}, credentials={}, soap_header_extra_info={})
|
|
22
|
+
client = Savon.client(savon_params(params, credentials, soap_header_extra_info))
|
|
23
|
+
cache_wsdl(client)
|
|
24
|
+
client
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def savon_params(params={}, credentials={}, soap_header_extra_info={})
|
|
28
|
+
full_params = {
|
|
29
|
+
wsdl: cached_wsdl || wsdl,
|
|
30
|
+
endpoint: endpoint,
|
|
31
|
+
read_timeout: read_timeout,
|
|
32
|
+
open_timeout: open_timeout,
|
|
33
|
+
namespaces: namespaces,
|
|
34
|
+
soap_header: auth_header(credentials).update(soap_header).merge(soap_header_extra_info),
|
|
35
|
+
pretty_print_xml: true,
|
|
36
|
+
filters: filters,
|
|
37
|
+
logger: logger,
|
|
38
|
+
log_level: log_level,
|
|
39
|
+
log: !silent, # turn off logging entirely if configured
|
|
40
|
+
proxy: proxy,
|
|
41
|
+
}
|
|
42
|
+
full_params.update(params)
|
|
43
|
+
full_params.update(write_timeout: write_timeout) if supports_write_timeout?
|
|
44
|
+
full_params
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def filters(list = nil)
|
|
49
|
+
if list
|
|
50
|
+
self.filters = list
|
|
51
|
+
else
|
|
52
|
+
attributes[:filters] ||= [
|
|
53
|
+
:password,
|
|
54
|
+
:email,
|
|
55
|
+
:consumerKey,
|
|
56
|
+
:token
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def filters=(list)
|
|
62
|
+
attributes[:filters] = list
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def wsdl_cache
|
|
66
|
+
if multi_tenant?
|
|
67
|
+
Thread.current[:netsuite_gem_wsdl_cache] ||= {}
|
|
68
|
+
else
|
|
69
|
+
@wsdl_cache ||= {}
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def clear_wsdl_cache
|
|
74
|
+
if multi_tenant?
|
|
75
|
+
Thread.current[:netsuite_gem_wsdl_cache] = {}
|
|
76
|
+
else
|
|
77
|
+
@wsdl_cache = {}
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def cached_wsdl
|
|
82
|
+
cached = wsdl_cache.fetch(wsdl, nil)
|
|
83
|
+
if cached.is_a? String
|
|
84
|
+
cached
|
|
85
|
+
elsif cached.is_a? Savon::Client
|
|
86
|
+
wsdl_cache[wsdl] = cached.instance_eval { @wsdl.xml }
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def cache_wsdl(client)
|
|
91
|
+
# NOTE the Savon::Client doesn't pull the wsdl content upon
|
|
92
|
+
# instantiation; it pulls it when it recieves the #call method.
|
|
93
|
+
# If we force it to pull the wsdl here, it will duplicate the call later.
|
|
94
|
+
# So, we stash the entire client and fetch just the wsdl from it after
|
|
95
|
+
# it completes its call
|
|
96
|
+
# For reference, see:
|
|
97
|
+
# https://github.com/savonrb/savon/blob/d64925d3add33fa5531577ce9e3a28a7a93618b1/lib/savon/client.rb#L35-L37
|
|
98
|
+
# https://github.com/savonrb/savon/blob/d64925d3add33fa5531577ce9e3a28a7a93618b1/lib/savon/operation.rb#L22
|
|
99
|
+
wsdl_cache[wsdl] ||= client
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
REQUIRED_API_VERSION = '2025_2'.freeze
|
|
103
|
+
|
|
104
|
+
def api_version(version = nil)
|
|
105
|
+
if version
|
|
106
|
+
self.api_version = version
|
|
107
|
+
else
|
|
108
|
+
attributes[:api_version] or
|
|
109
|
+
raise ConfigurationError, "api_version is not set. Add `api_version '#{REQUIRED_API_VERSION}'` to your NetSuite.configure block."
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def api_version=(version)
|
|
114
|
+
unless version == REQUIRED_API_VERSION
|
|
115
|
+
raise ConfigurationError, "api_version must be '#{REQUIRED_API_VERSION}' — NetSuite SOAP 2025.2 is the final supported endpoint (removed 2028.2)."
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes[:api_version] != version
|
|
119
|
+
attributes[:wsdl] = nil
|
|
120
|
+
attributes[:wsdl_domain] = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
attributes[:api_version] = version
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def endpoint=(endpoint)
|
|
127
|
+
attributes[:endpoint] = endpoint
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def endpoint(endpoint=nil)
|
|
131
|
+
if endpoint
|
|
132
|
+
self.endpoint = endpoint
|
|
133
|
+
else
|
|
134
|
+
attributes[:endpoint]
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def sandbox=(flag)
|
|
139
|
+
if attributes[:sandbox] != flag
|
|
140
|
+
attributes[:wsdl] = nil
|
|
141
|
+
attributes[:wsdl_domain] = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
attributes[:sandbox] = flag
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def sandbox(flag = nil)
|
|
148
|
+
if flag.nil?
|
|
149
|
+
attributes[:sandbox] ||= false
|
|
150
|
+
else
|
|
151
|
+
self.sandbox = flag
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def sandbox?
|
|
156
|
+
!!sandbox
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def wsdl=(wsdl)
|
|
160
|
+
attributes[:wsdl] = wsdl
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def wsdl(wsdl = nil)
|
|
164
|
+
if wsdl
|
|
165
|
+
self.wsdl = wsdl
|
|
166
|
+
else
|
|
167
|
+
attributes[:wsdl] ||= begin
|
|
168
|
+
if sandbox
|
|
169
|
+
"https://webservices.sandbox.netsuite.com/wsdl/v#{api_version}_0/netsuite.wsdl"
|
|
170
|
+
else
|
|
171
|
+
"https://#{wsdl_domain}/wsdl/v#{api_version}_0/netsuite.wsdl"
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def wsdl_domain(wsdl_domain = nil)
|
|
178
|
+
if wsdl_domain
|
|
179
|
+
self.wsdl_domain = wsdl_domain
|
|
180
|
+
else
|
|
181
|
+
# if sandbox, this parameter is ignored
|
|
182
|
+
if sandbox
|
|
183
|
+
'webservices.sandbox.netsuite.com'
|
|
184
|
+
else
|
|
185
|
+
attributes[:wsdl_domain] ||= 'webservices.netsuite.com'
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def wsdl_domain=(wsdl_domain)
|
|
191
|
+
if attributes[:wsdl_domain] != wsdl_domain
|
|
192
|
+
# reset full wsdl url to ensure it's regenerated with the updated `wsdl_domain` next time it's needed
|
|
193
|
+
attributes[:wsdl] = nil
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
attributes[:wsdl_domain] = wsdl_domain
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def soap_header=(headers)
|
|
200
|
+
attributes[:soap_header] = headers
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def soap_header(headers = nil)
|
|
204
|
+
if headers
|
|
205
|
+
self.soap_header = headers
|
|
206
|
+
else
|
|
207
|
+
attributes[:soap_header] ||= {}
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def auth_header(credentials={})
|
|
212
|
+
if !credentials[:consumer_key].to_s.strip.empty? || !consumer_key.to_s.strip.empty?
|
|
213
|
+
token_auth(credentials)
|
|
214
|
+
else
|
|
215
|
+
user_auth(credentials)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
def user_auth(credentials)
|
|
220
|
+
NetSuite::Passports::User.new(
|
|
221
|
+
credentials[:account] || account,
|
|
222
|
+
credentials[:email] || email,
|
|
223
|
+
credentials[:password] || password,
|
|
224
|
+
credentials[:role] || role
|
|
225
|
+
).passport
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def token_auth(credentials)
|
|
229
|
+
NetSuite::Passports::Token.new(
|
|
230
|
+
credentials[:account] || account,
|
|
231
|
+
credentials[:consumer_key] || consumer_key,
|
|
232
|
+
credentials[:consumer_secret] || consumer_secret,
|
|
233
|
+
credentials[:token_id] || token_id,
|
|
234
|
+
credentials[:token_secret] || token_secret
|
|
235
|
+
).passport
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def namespaces
|
|
239
|
+
{
|
|
240
|
+
'xmlns:platformMsgs' => "urn:messages_#{api_version}.platform.webservices.netsuite.com",
|
|
241
|
+
'xmlns:platformCore' => "urn:core_#{api_version}.platform.webservices.netsuite.com",
|
|
242
|
+
'xmlns:platformCommon' => "urn:common_#{api_version}.platform.webservices.netsuite.com",
|
|
243
|
+
'xmlns:listRel' => "urn:relationships_#{api_version}.lists.webservices.netsuite.com",
|
|
244
|
+
'xmlns:tranSales' => "urn:sales_#{api_version}.transactions.webservices.netsuite.com",
|
|
245
|
+
'xmlns:tranPurch' => "urn:purchases_#{api_version}.transactions.webservices.netsuite.com",
|
|
246
|
+
'xmlns:actSched' => "urn:scheduling_#{api_version}.activities.webservices.netsuite.com",
|
|
247
|
+
'xmlns:setupCustom' => "urn:customization_#{api_version}.setup.webservices.netsuite.com",
|
|
248
|
+
'xmlns:listAcct' => "urn:accounting_#{api_version}.lists.webservices.netsuite.com",
|
|
249
|
+
'xmlns:tranBank' => "urn:bank_#{api_version}.transactions.webservices.netsuite.com",
|
|
250
|
+
'xmlns:tranCust' => "urn:customers_#{api_version}.transactions.webservices.netsuite.com",
|
|
251
|
+
'xmlns:tranEmp' => "urn:employees_#{api_version}.transactions.webservices.netsuite.com",
|
|
252
|
+
'xmlns:tranInvt' => "urn:inventory_#{api_version}.transactions.webservices.netsuite.com",
|
|
253
|
+
'xmlns:listSupport' => "urn:support_#{api_version}.lists.webservices.netsuite.com",
|
|
254
|
+
'xmlns:tranGeneral' => "urn:general_#{api_version}.transactions.webservices.netsuite.com",
|
|
255
|
+
'xmlns:commGeneral' => "urn:communication_#{api_version}.general.webservices.netsuite.com",
|
|
256
|
+
'xmlns:listMkt' => "urn:marketing_#{api_version}.lists.webservices.netsuite.com",
|
|
257
|
+
'xmlns:listWebsite' => "urn:website_#{api_version}.lists.webservices.netsuite.com",
|
|
258
|
+
'xmlns:fileCabinet' => "urn:filecabinet_#{api_version}.documents.webservices.netsuite.com",
|
|
259
|
+
'xmlns:listEmp' => "urn:employees_#{api_version}.lists.webservices.netsuite.com"
|
|
260
|
+
}
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
def role=(role)
|
|
264
|
+
attributes[:role] = role
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
def role(role = nil)
|
|
268
|
+
if role
|
|
269
|
+
self.role = role
|
|
270
|
+
else
|
|
271
|
+
attributes[:role] ||= '3'
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
def email=(email)
|
|
276
|
+
attributes[:email] = email
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
def email(email = nil)
|
|
280
|
+
if email
|
|
281
|
+
self.email = email
|
|
282
|
+
else
|
|
283
|
+
attributes[:email]
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
def password=(password)
|
|
288
|
+
attributes[:password] = password
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
def password(password = nil)
|
|
292
|
+
if password
|
|
293
|
+
self.password = password
|
|
294
|
+
else
|
|
295
|
+
attributes[:password]
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def account=(account)
|
|
300
|
+
attributes[:account] = account
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
def account(account = nil)
|
|
304
|
+
if account
|
|
305
|
+
self.account = account
|
|
306
|
+
else
|
|
307
|
+
attributes[:account]
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
def consumer_key=(consumer_key)
|
|
312
|
+
attributes[:consumer_key] = consumer_key
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
def consumer_key(consumer_key = nil)
|
|
316
|
+
if consumer_key
|
|
317
|
+
self.consumer_key = consumer_key
|
|
318
|
+
else
|
|
319
|
+
attributes[:consumer_key]
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
def consumer_secret=(consumer_secret)
|
|
324
|
+
attributes[:consumer_secret] = consumer_secret
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
def consumer_secret(consumer_secret = nil)
|
|
328
|
+
if consumer_secret
|
|
329
|
+
self.consumer_secret = consumer_secret
|
|
330
|
+
else
|
|
331
|
+
attributes[:consumer_secret]
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
def token_id=(token_id)
|
|
336
|
+
attributes[:token_id] = token_id
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
def token_id(token_id = nil)
|
|
340
|
+
if token_id
|
|
341
|
+
self.token_id = token_id
|
|
342
|
+
else
|
|
343
|
+
attributes[:token_id]
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def token_secret=(token_secret)
|
|
348
|
+
attributes[:token_secret] = token_secret
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
def token_secret(token_secret = nil)
|
|
352
|
+
if token_secret
|
|
353
|
+
self.token_secret = token_secret
|
|
354
|
+
else
|
|
355
|
+
attributes[:token_secret]
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
def read_timeout=(timeout)
|
|
360
|
+
attributes[:read_timeout] = timeout
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
def read_timeout(timeout = nil)
|
|
364
|
+
if timeout
|
|
365
|
+
self.read_timeout = timeout
|
|
366
|
+
else
|
|
367
|
+
attributes[:read_timeout] ||= 60
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
def open_timeout=(timeout)
|
|
372
|
+
attributes[:open_timeout] = timeout
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
def open_timeout(timeout = nil)
|
|
376
|
+
if timeout
|
|
377
|
+
self.open_timeout = timeout
|
|
378
|
+
else
|
|
379
|
+
attributes[:open_timeout]
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
def write_timeout=(timeout)
|
|
384
|
+
write_timeout_not_supported! unless supports_write_timeout?
|
|
385
|
+
attributes[:write_timeout] = timeout
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
def write_timeout(timeout = nil)
|
|
389
|
+
if timeout
|
|
390
|
+
write_timeout_not_supported! unless supports_write_timeout?
|
|
391
|
+
self.write_timeout = timeout
|
|
392
|
+
else
|
|
393
|
+
attributes[:write_timeout]
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
def log=(path)
|
|
398
|
+
attributes[:log] = path
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
def log(path = nil)
|
|
402
|
+
self.log = path if path
|
|
403
|
+
attributes[:log]
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def logger(value = nil)
|
|
407
|
+
if value.nil?
|
|
408
|
+
# if passed a IO object (like StringIO) `empty?` won't exist
|
|
409
|
+
valid_log = log && !(log.respond_to?(:empty?) && log.empty?)
|
|
410
|
+
|
|
411
|
+
attributes[:logger] ||= ::Logger.new(valid_log ? log : $stdout)
|
|
412
|
+
else
|
|
413
|
+
attributes[:logger] = value
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
def logger=(value)
|
|
418
|
+
attributes[:logger] = value
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
def silent(value=nil)
|
|
422
|
+
self.silent = value if !value.nil?
|
|
423
|
+
attributes[:silent]
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
def silent=(value)
|
|
427
|
+
attributes[:silent] ||= value
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
def log_level(value = nil)
|
|
431
|
+
self.log_level = value if value
|
|
432
|
+
|
|
433
|
+
attributes[:log_level] || :debug
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
def log_level=(value)
|
|
437
|
+
attributes[:log_level] = value
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
def proxy=(proxy)
|
|
441
|
+
attributes[:proxy] = proxy
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
def proxy(proxy = nil)
|
|
445
|
+
if proxy
|
|
446
|
+
self.proxy = proxy
|
|
447
|
+
else
|
|
448
|
+
attributes[:proxy]
|
|
449
|
+
end
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
def multi_tenant!
|
|
453
|
+
@multi_tenant = true
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
def multi_tenant?
|
|
457
|
+
@multi_tenant
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
private
|
|
461
|
+
|
|
462
|
+
def supports_write_timeout?
|
|
463
|
+
Savon::VERSION >= "2.13.0"
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
def write_timeout_not_supported!
|
|
467
|
+
fail(ConfigurationError, "Savon doesn't support write_timeout until version 2.13.0")
|
|
468
|
+
end
|
|
469
|
+
end
|
|
470
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module NetSuite
|
|
2
|
+
class RecordNotFound < StandardError; end
|
|
3
|
+
class InitializationError < StandardError; end
|
|
4
|
+
class ConfigurationError < StandardError; end
|
|
5
|
+
|
|
6
|
+
# NOTE not an exception, used as a wrapped around NetSuite SOAP error
|
|
7
|
+
class Error
|
|
8
|
+
attr_accessor :type, :code, :message
|
|
9
|
+
|
|
10
|
+
def initialize(args = {})
|
|
11
|
+
@type = args[:@type]
|
|
12
|
+
@code = args[:code]
|
|
13
|
+
@message = args[:message]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
alias_method :to_s, :inspect
|
|
17
|
+
end
|
|
18
|
+
end
|