lib/netsuite/actions/upsert.rb in netsuite-0.9.2 vs lib/netsuite/actions/upsert.rb in netsuite-0.9.3
- old
+ new
@@ -1,23 +1,19 @@
# https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/upsert.html
module NetSuite
module Actions
- class Upsert
+ class Upsert < AbstractAction
include Support::Requests
attr_reader :response_hash
def initialize(object = nil)
@object = object
end
private
- def request(credentials={})
- NetSuite::Configuration.connection({}, credentials).call :upsert, :message => request_body
- end
-
# <soap:Body>
# <platformMsgs:upsert>
# <platformMsgs:record xsi:type="listRel:Customer">
# <listRel:entityId>Shutter Fly</listRel:entityId>
# <listRel:companyName>Shutter Fly, Inc</listRel:companyName>
@@ -64,9 +60,13 @@
error_obj = response_hash[:status][:status_detail]
error_obj = [error_obj] if error_obj.class == Hash
error_obj.map do |error|
NetSuite::Error.new(error)
end
+ end
+
+ def action_name
+ :upsert
end
module Support
def upsert(credentials={})
response = NetSuite::Actions::Upsert.call([self], credentials)