Module: SfCli::Sf::Data::DeleteBulk
- Included in:
- Core
- Defined in:
- lib/sf_cli/sf/data/delete_bulk.rb
Instance Method Summary collapse
-
#delete_bulk(file:, sobject:, wait: nil, target_org: nil, api_version: nil) ⇒ JobInfo, BulkResultV2
Delete records using Bulk API 2.0.
Instance Method Details
#delete_bulk(file:, sobject:, wait: nil, target_org: nil, api_version: nil) ⇒ JobInfo, BulkResultV2
Delete records using Bulk API 2.0
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/sf_cli/sf/data/delete_bulk.rb', line 39 def delete_bulk(file:, sobject:, wait: nil, target_org: nil, api_version: nil) _file = create_tmpfile_by_io(file) path = _file&.path || file flags = { :"file" => path, :"sobject" => sobject, :"wait" => wait, :"target-org" => target_org, :"api-version" => api_version, } action = __method__.to_s.tr('_', ' ') json = exec(action, flags: flags, redirection: :null_stderr) job_info = ::SfCli::Sf::Data::JobInfo.new(**json['result']['jobInfo']) return job_info unless json['result']['records'] ::SfCli::Sf::Data::BulkResultV2.new( job_info: job_info, records: ::SfCli::Sf::Data::BulkRecordsV2.new(**json['result']['records']) ) ensure _file&.close! end |