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, 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, 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.
31 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 |
# File 'lib/sf_cli/sf/project/retrieve_start.rb', line 31 def retrieve_start(metadata: nil, manifest: nil, source_dir: nil, package_name: nil, target_org: nil, output_dir: nil, 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('_', ' ') json = exec(action, flags: flags, switches: switches, redirection: :null_stderr) Result.new( done: json['result']['done'], file_properties: json['result']['fileProperties'].map{|fp| create_file_property(fp)}, id: json['result']['id'], status: json['result']['status'], success: json['result']['success'], messages: json['result']['messages'], files: json['result']['files'].map{|f| create_retrieved_file(f)} ) end |