Class: SfCli::Sf::Sobject::Core
- Inherits:
-
Object
- Object
- SfCli::Sf::Sobject::Core
- Includes:
- Core::Base
- Defined in:
- lib/sf_cli/sf/sobject/core.rb
Overview
description
The class representing sf sobject
command reference: developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_sobject_commands_unified.htm
Instance Attribute Summary
Attributes included from Core::Base
Instance Method Summary collapse
-
#describe(object_type, target_org: nil) ⇒ Object
returns a hash object containing the Salesforce object schema.
-
#list(object_type, target_org: nil) ⇒ Object
returns a list of Salesforce object API name.
Instance Method Details
#describe(object_type, target_org: nil) ⇒ Object
returns a hash object containing the Salesforce object schema. (equivalent to sf sobject describe)
objectType — object type (ex: Account)
target_org — an alias of paticular org, not default one
For more command details, see the command reference
21 22 23 24 25 26 27 28 |
# File 'lib/sf_cli/sf/sobject/core.rb', line 21 def describe(object_type, target_org: nil) flags = { :"sobject" => object_type, :"target-org" => target_org, } json = exec(__method__, flags: flags, redirection: :null_stderr) json['result'] end |
#list(object_type, target_org: nil) ⇒ Object
returns a list of Salesforce object API name. (equivalent to sf sobject list)
object_type — all or custom
target_org — an alias of paticular org, not default one
For more command details, see the command reference
37 38 39 40 41 42 43 44 |
# File 'lib/sf_cli/sf/sobject/core.rb', line 37 def list(object_type, target_org: nil) flags = { :"sobject" => (object_type.to_sym == :custom ? :custom : :all), :"target-org" => target_org, } json = exec(__method__, flags: flags, redirection: :null_stderr) json['result'] end |