Module: SfCli::Sf::Org::ListMetadataTypes

Defined in:
lib/sf_cli/sf/org/list_metadata_types.rb

Defined Under Namespace

Classes: MetadataObjects

Constant Summary collapse

MetadataObject =
Data.define(:directory_name, :in_folder, :meta_file, :suffix, :xml_name, :child_xml_names) do
  def name
    xml_name
  end

  def in_folder?
    in_folder
  end

  def meta_file?
    meta_file
  end
end
Result =
Data.define(:metadata_objects, :organization_namespace, :partial_save_allowed, :test_required)

Instance Method Summary collapse

Instance Method Details

#list_metadata_types(target_org: nil, api_version: nil, output_file: nil, raw_output: false) ⇒ Result

Returns the metadata types that are enabled for your org.

Examples:

result = sf.org. target_org: :dev
result..names #=> ["InstalledPackage","CustomLabels", ...]

Parameters:

  • target_org (Symbol, String) (defaults to: nil)

    an alias of paticular org, or username can be used

  • api_version (Numeric) (defaults to: nil)

    override the api version used for api requests made by this command

  • output_file (String) (defaults to: nil)

    pathname of the file in which to write the results

  • raw_output (Boolian) (defaults to: false)

    return the original command’s output.

Returns:

  • (Result)

    the command’s output

See Also:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/sf_cli/sf/org/list_metadata_types.rb', line 18

def (target_org: nil, api_version: nil, output_file: nil, raw_output: false)
  flags    = {
    :"target-org" => target_org,
    :"api-version" => api_version,
    :"output-file" => output_file,
  }
  action = __method__.to_s.tr('_', '-').sub('-', ' ')
  output = org_exec(action, flags: flags, redirection: :null_stderr, raw_output: raw_output)
  return output if raw_output

  Result.new(
    metadata_objects:       MetadataObjects.new(output['result']['metadataObjects']),
    organization_namespace: output['result']['organizationNamespace'],
    partial_save_allowed:   output['result']['partialSaveAllowed'],
    test_required:          output['result']['testRequired']
  )
end