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) ⇒ 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

Returns:

  • (Result)

    the command’s output

See Also:



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

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

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