Module: SfCli::Sf::Project::RetrieveStart
- Included in:
- Core
- Defined in:
- lib/sf_cli/sf/project/retrieve_start.rb
Constant Summary collapse
- Result =
Data.define(:done, :file_properties, :id, :status, :success, :messages, :files) do def success? success end end
- FileProperty =
Data.define(:created_by_id, :created_by_name, :created_date, :file_name, :full_name, :id, :last_modified_by_id, :last_modified_by_name, :last_modified_date, :manageable_state, :type)
- RetrievedFile =
Data.define(:full_name, :type, :state, :file_path)
Instance Method Summary collapse
-
#retrieve_start(metadata: nil, manifest: nil, source_dir: nil, package_name: nil, target_org: nil, output_dir: nil, raw_output: false, api_version: nil, wait: nil, target_metadata_dir: nil, zip_file_name: nil, ignore_conflicts: false, single_package: false, unzip: false) ⇒ Result
Retrieve metadata from an org to your local project.
Instance Method Details
#retrieve_start(metadata: nil, manifest: nil, source_dir: nil, package_name: nil, target_org: nil, output_dir: nil, raw_output: false, api_version: nil, wait: nil, target_metadata_dir: nil, zip_file_name: nil, ignore_conflicts: false, single_package: false, unzip: false) ⇒ Result
Retrieve metadata from an org to your local project.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/sf_cli/sf/project/retrieve_start.rb', line 32 def retrieve_start(metadata: nil, manifest: nil, source_dir: nil, package_name: nil, target_org: nil, output_dir: nil, raw_output: false, api_version: nil, wait: nil, target_metadata_dir: nil, zip_file_name: nil, ignore_conflicts: false, single_package: false, unzip: false) flags = { :manifest => manifest, :metadata => &.join(' '), :"source-dir" => source_dir, :"package-name" => package_name&.join(' '), :"target-org" => target_org, :"output-dir" => output_dir, :"api-version" => api_version, :"wait" => wait, :"target-metadata-dir" => , :"zip-file-name" => zip_file_name, } switches = { :"ignore-conflicts" => ignore_conflicts, :"single-package" => single_package, :"unzip" => unzip, } action = __method__.to_s.tr('_', ' ') command_output_format = raw_output ? :human : :json redirect_type = raw_output ? nil : :null_stderr output = exec(action, flags: flags, switches: switches, redirection: redirect_type, raw_output: raw_output, format: command_output_format) return output if raw_output Result.new( done: output['result']['done'], file_properties: output['result']['fileProperties'].map{|fp| create_file_property(fp)}, id: output['result']['id'], status: output['result']['status'], success: output['result']['success'], messages: output['result']['messages'], files: output['result']['files'].map{|f| create_retrieved_file(f)} ) end |